#include "chrome/browser/ui/views/profiles/profile_picker_signed_in_flow_controller.h"
#include "base/strings/string_util.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/themes/theme_service.h"
#include "chrome/browser/themes/theme_service_factory.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/views/profiles/profile_management_types.h"
#include "chrome/browser/ui/views/profiles/profile_picker_turn_sync_on_delegate.h"
#include "chrome/browser/ui/webui/signin/signin_url_utils.h"
#include "chrome/browser/ui/webui/signin/signin_utils.h"
#include "chrome/browser/ui/webui/signin/sync_confirmation_ui.h"
#include "chrome/browser/ui/webui/signin/turn_sync_on_helper.h"
#include "chrome/common/url_constants.h"
#include "chrome/common/webui_url_constants.h"
#include "components/signin/public/base/signin_metrics.h"
#include "components/signin/public/identity_manager/account_info.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/render_frame_host.h"
#include "ui/base/window_open_disposition.h"
namespace {
bool ShouldOpenUrlAfterBrowserCreation(const GURL& url) { … }
void OpenNewTabInBrowser(const GURL& url, Browser* browser) { … }
}
ProfilePickerSignedInFlowController::ProfilePickerSignedInFlowController(
ProfilePickerWebContentsHost* host,
Profile* profile,
const CoreAccountInfo& account_info,
std::unique_ptr<content::WebContents> contents,
signin_metrics::AccessPoint signin_access_point,
std::optional<SkColor> profile_color)
: … { … }
ProfilePickerSignedInFlowController::~ProfilePickerSignedInFlowController() { … }
void ProfilePickerSignedInFlowController::Init() { … }
void ProfilePickerSignedInFlowController::Cancel() { … }
void ProfilePickerSignedInFlowController::FinishAndOpenBrowser(
PostHostClearedCallback callback) { … }
void ProfilePickerSignedInFlowController::SwitchToSyncConfirmation() { … }
void ProfilePickerSignedInFlowController::SwitchToManagedUserProfileNotice(
ManagedUserProfileNoticeUI::ScreenType type,
signin::SigninChoiceCallback process_user_choice_callback) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
void ProfilePickerSignedInFlowController::SwitchToLacrosIntro(
signin::SigninChoiceCallback proceed_callback) {
NOTREACHED_IN_MIGRATION();
}
#endif
void ProfilePickerSignedInFlowController::SwitchToProfileSwitch(
const base::FilePath& profile_path) { … }
std::optional<SkColor> ProfilePickerSignedInFlowController::GetProfileColor()
const { … }
GURL ProfilePickerSignedInFlowController::GetSyncConfirmationURL(bool loading) { … }
std::unique_ptr<content::WebContents>
ProfilePickerSignedInFlowController::ReleaseContents() { … }
bool ProfilePickerSignedInFlowController::HandleContextMenu(
content::RenderFrameHost& render_frame_host,
const content::ContextMenuParams& params) { … }
bool ProfilePickerSignedInFlowController::HandleKeyboardEvent(
content::WebContents* source,
const input::NativeWebKeyboardEvent& event) { … }
void ProfilePickerSignedInFlowController::SwitchToSyncConfirmationFinished() { … }
void ProfilePickerSignedInFlowController::
SwitchToManagedUserProfileNoticeFinished(
ManagedUserProfileNoticeUI::ScreenType type,
signin::SigninChoiceCallback process_user_choice_callback) { … }
bool ProfilePickerSignedInFlowController::IsInitialized() const { … }