blob: b6d3a8f356b7a93876f6a24f86ca8b6fdfa7f6ee [file] [log] [blame]
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ash/test/fake_android_intent_helper.h"
namespace ash {
FakeAndroidIntentHelper::FakeAndroidIntentHelper() = default;
FakeAndroidIntentHelper::~FakeAndroidIntentHelper() = default;
void FakeAndroidIntentHelper::LaunchAndroidIntent(const std::string& intent) {
last_launched_intent_ = intent;
}
absl::optional<std::string> FakeAndroidIntentHelper::GetAndroidAppLaunchIntent(
const chromeos::assistant::AndroidAppInfo& app_info) {
auto iterator = apps_.find(app_info.localized_app_name);
if (iterator != apps_.end())
return iterator->second;
return absl::nullopt;
}
void FakeAndroidIntentHelper::AddApp(const LocalizedAppName& name,
const Intent& intent) {
apps_[name] = intent;
}
} // namespace ash