#include "chrome/browser/ui/profiles/profile_picker.h"
#include <string>
#include "base/containers/flat_set.h"
#include "base/metrics/histogram_functions.h"
#include "base/ranges/algorithm.h"
#include "base/time/time.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_manager.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/ui/startup/startup_browser_creator.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/webui_url_constants.h"
#include "components/prefs/pref_service.h"
namespace {
constexpr base::TimeDelta kActiveTimeThreshold = …;
ProfilePicker::AvailabilityOnStartup GetAvailabilityOnStartup() { … }
}
const char ProfilePicker::kTaskManagerUrl[] = …;
ProfilePicker::Params::~Params() { … }
ProfilePicker::Params::Params(ProfilePicker::Params&&) = default;
ProfilePicker::Params& ProfilePicker::Params::operator=(
ProfilePicker::Params&&) = default;
ProfilePicker::Params ProfilePicker::Params::FromEntryPoint(
EntryPoint entry_point) { … }
ProfilePicker::Params ProfilePicker::Params::ForBackgroundManager(
const GURL& on_select_profile_target_url) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
ProfilePicker::Params ProfilePicker::Params::ForLacrosSelectAvailableAccount(
const base::FilePath& profile_path,
base::OnceCallback<void(const std::string&)> account_selected_callback) {
Params params(EntryPoint::kLacrosSelectAvailableAccount,
profile_path.empty() ? GetPickerProfilePath() : profile_path);
params.account_selected_callback_ = std::move(account_selected_callback);
return params;
}
void ProfilePicker::Params::NotifyAccountSelected(const std::string& gaia_id) {
if (account_selected_callback_) {
std::move(account_selected_callback_).Run(gaia_id);
}
}
#endif
ProfilePicker::Params ProfilePicker::Params::ForFirstRun(
const base::FilePath& profile_path,
FirstRunExitedCallback first_run_exited_callback) { … }
void ProfilePicker::Params::NotifyFirstRunExited(
FirstRunExitStatus exit_status) { … }
bool ProfilePicker::Params::CanReusePickerWindow(const Params& other) const { … }
ProfilePicker::Params::Params(EntryPoint entry_point,
const base::FilePath& profile_path)
: … { … }
bool ProfilePicker::Shown() { … }
StartupProfileModeReason ProfilePicker::GetStartupModeReason() { … }