#include "chrome/browser/password_manager/web_app_profile_switcher.h"
#include <memory>
#include <optional>
#include "base/command_line.h"
#include "base/files/file_path.h"
#include "base/functional/callback_helpers.h"
#include "base/metrics/histogram_macros.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/profiles/profile_window.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/web_applications/app_browser_controller.h"
#include "chrome/browser/web_applications/locks/app_lock.h"
#include "chrome/browser/web_applications/mojom/user_display_mode.mojom-shared.h"
#include "chrome/browser/web_applications/web_app.h"
#include "chrome/browser/web_applications/web_app_command_scheduler.h"
#include "chrome/browser/web_applications/web_app_helpers.h"
#include "chrome/browser/web_applications/web_app_icon_manager.h"
#include "chrome/browser/web_applications/web_app_id_constants.h"
#include "chrome/browser/web_applications/web_app_install_info.h"
#include "chrome/browser/web_applications/web_app_provider.h"
#include "chrome/browser/web_applications/web_app_registrar.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/webapps/browser/install_result_code.h"
#include "content/public/browser/browser_thread.h"
namespace {
std::unique_ptr<web_app::WebAppInstallInfo> MakeInstallInfoFromApp(
const web_app::WebApp& web_app) { … }
}
WebAppProfileSwitcher::WebAppProfileSwitcher(const webapps::AppId& app_id,
Profile& active_profile,
base::OnceClosure on_completion)
: … { … }
WebAppProfileSwitcher::~WebAppProfileSwitcher() = default;
void WebAppProfileSwitcher::SwitchToProfile(
const base::FilePath& profile_to_open) { … }
void WebAppProfileSwitcher::OnProfileWillBeDestroyed(Profile* profile) { … }
void WebAppProfileSwitcher::QueryProfileWebAppRegistryToOpenWebApp(
Profile* new_profile) { … }
void WebAppProfileSwitcher::InstallOrOpenWebAppWindowForProfile(
web_app::AppLock& new_profile_lock,
base::Value::Dict& debug_value) { … }
void WebAppProfileSwitcher::InstallAndLaunchWebApp(
web_app::IconBitmaps icon_bitmaps) { … }
void WebAppProfileSwitcher::LaunchAppWithId(
const webapps::AppId& app_id,
webapps::InstallResultCode install_result) { … }
void WebAppProfileSwitcher::RunCompletionCallback() { … }