#include "chrome/browser/profiles/profile_manager.h"
#include <stdint.h>
#include <cstddef>
#include <map>
#include <memory>
#include <numeric>
#include <set>
#include <string>
#include <utility>
#include "base/command_line.h"
#include "base/containers/contains.h"
#include "base/debug/stack_trace.h"
#include "base/feature_list.h"
#include "base/files/file_enumerator.h"
#include "base/files/file_path.h"
#include "base/files/file_util.h"
#include "base/functional/bind.h"
#include "base/functional/callback.h"
#include "base/functional/callback_helpers.h"
#include "base/json/values_util.h"
#include "base/memory/raw_ptr.h"
#include "base/metrics/histogram_functions.h"
#include "base/metrics/histogram_macros.h"
#include "base/not_fatal_until.h"
#include "base/observer_list.h"
#include "base/ranges/algorithm.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/task/thread_pool.h"
#include "base/threading/scoped_blocking_call.h"
#include "base/trace_event/trace_event.h"
#include "build/build_config.h"
#include "build/chromeos_buildflags.h"
#include "chrome/browser/accessibility/accessibility_labels_service.h"
#include "chrome/browser/accessibility/accessibility_labels_service_factory.h"
#include "chrome/browser/browser_features.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager.h"
#include "chrome/browser/browsing_data/chrome_browsing_data_lifetime_manager_factory.h"
#include "chrome/browser/buildflags.h"
#include "chrome/browser/extensions/chrome_content_browser_client_extensions_part.h"
#include "chrome/browser/lifetime/application_lifetime.h"
#include "chrome/browser/navigation_predictor/navigation_predictor_keyed_service_factory.h"
#include "chrome/browser/navigation_predictor/preloading_model_keyed_service_factory.h"
#include "chrome/browser/permissions/adaptive_quiet_notification_permission_ui_enabler.h"
#include "chrome/browser/prefs/incognito_mode_prefs.h"
#include "chrome/browser/profiles/delete_profile_helper.h"
#include "chrome/browser/profiles/keep_alive/profile_keep_alive_types.h"
#include "chrome/browser/profiles/profile_attributes_entry.h"
#include "chrome/browser/profiles/profile_attributes_init_params.h"
#include "chrome/browser/profiles/profile_attributes_storage.h"
#include "chrome/browser/profiles/profile_avatar_icon_util.h"
#include "chrome/browser/profiles/profile_destroyer.h"
#include "chrome/browser/profiles/profile_key.h"
#include "chrome/browser/profiles/profile_manager_observer.h"
#include "chrome/browser/profiles/profile_selections.h"
#include "chrome/browser/profiles/profiles_state.h"
#include "chrome/browser/signin/account_reconcilor_factory.h"
#include "chrome/browser/signin/identity_manager_factory.h"
#include "chrome/browser/signin/primary_account_policy_manager_factory.h"
#include "chrome/browser/signin/signin_util.h"
#include "chrome/browser/supervised_user/child_accounts/child_account_service_factory.h"
#include "chrome/browser/supervised_user/child_accounts/list_family_members_service_factory.h"
#include "chrome/browser/supervised_user/supervised_user_service_factory.h"
#include "chrome/browser/ui/tabs/organization/tab_organization_service_factory.h"
#include "chrome/browser/ui/ui_features.h"
#include "chrome/browser/unified_consent/unified_consent_service_factory.h"
#include "chrome/common/buildflags.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_switches.h"
#include "chrome/common/logging_chrome.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/url_constants.h"
#include "chrome/grit/generated_resources.h"
#include "components/account_id/account_id.h"
#include "components/bookmarks/common/bookmark_pref_names.h"
#include "components/browsing_data/core/pref_names.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/crash/core/common/crash_key.h"
#include "components/policy/core/common/policy_pref_names.h"
#include "components/prefs/pref_service.h"
#include "components/prefs/scoped_user_pref_update.h"
#include "components/search_engines/default_search_manager.h"
#include "components/signin/core/browser/active_primary_accounts_metrics_recorder.h"
#include "components/signin/public/base/consent_level.h"
#include "components/signin/public/base/signin_buildflags.h"
#include "components/signin/public/base/signin_metrics.h"
#include "components/signin/public/base/signin_pref_names.h"
#include "components/signin/public/identity_manager/identity_manager.h"
#include "components/signin/public/identity_manager/primary_account_mutator.h"
#include "components/supervised_user/core/browser/child_account_service.h"
#include "components/supervised_user/core/browser/supervised_user_service.h"
#include "components/supervised_user/core/common/pref_names.h"
#include "components/supervised_user/core/common/supervised_user_constants.h"
#include "components/sync/base/stop_source.h"
#include "content/public/browser/browser_task_traits.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/storage_partition.h"
#include "content/public/common/content_switches.h"
#include "extensions/buildflags/buildflags.h"
#include "google_apis/gaia/gaia_auth_util.h"
#include "ui/base/l10n/l10n_util.h"
#if BUILDFLAG(ENABLE_EXTENSIONS_CORE)
#include "extensions/browser/extension_system.h"
#endif
#if BUILDFLAG(ENABLE_EXTENSIONS)
#include "chrome/browser/extensions/extension_service.h"
#include "extensions/browser/api/management/management_api.h"
#include "extensions/browser/extension_registry.h"
#include "extensions/common/extension_set.h"
#include "extensions/common/manifest.h"
#endif
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
#include "chrome/browser/sessions/app_session_service_factory.h"
#include "chrome/browser/sessions/session_service_factory.h"
#endif
#if !BUILDFLAG(IS_ANDROID)
#include "chrome/browser/accessibility/live_caption/live_caption_controller_factory.h"
#include "chrome/browser/lifetime/application_lifetime_desktop.h"
#include "chrome/browser/profiles/nuke_profile_directory_utils.h"
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_list.h"
#include "components/live_caption/live_caption_controller.h"
#include "components/optimization_guide/core/model_execution/model_execution_features.h"
#else
#include "chrome/browser/profiles/profile_manager_android.h"
#include "chrome/browser/signin/signin_manager_android_factory.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH)
#include "ash/components/arc/arc_prefs.h"
#include "ash/components/arc/session/arc_management_transition.h"
#include "ash/constants/ash_switches.h"
#include "base/debug/dump_without_crashing.h"
#include "base/system/sys_info.h"
#include "chrome/browser/ash/account_manager/account_manager_policy_controller_factory.h"
#include "chrome/browser/ash/account_manager/child_account_type_changed_user_data.h"
#include "chrome/browser/ash/arc/policy/arc_policy_util.h"
#include "chrome/browser/ash/profiles/profile_helper.h"
#include "chrome/browser/browser_process_platform_part_ash.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_helper.h"
#include "chromeos/ash/components/browser_context_helper/browser_context_types.h"
#include "components/user_manager/user.h"
#include "components/user_manager/user_manager.h"
#include "components/user_manager/user_type.h"
#endif
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
#include "chrome/browser/profiles/profile_statistics.h"
#include "chrome/browser/profiles/profile_statistics_factory.h"
#endif
#if BUILDFLAG(IS_WIN) && BUILDFLAG(ENABLE_DICE_SUPPORT)
#include "chrome/browser/signin/signin_util_win.h"
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
#include "chrome/browser/lacros/account_manager/account_profile_mapper.h"
#include "chrome/browser/ui/startup/first_run_service.h"
#include "chromeos/startup/browser_params_proxy.h"
#include "components/account_manager_core/chromeos/account_manager_facade_factory.h"
#endif
#if BUILDFLAG(IS_CHROMEOS)
#include "chrome/browser/chromeos/extensions/contact_center_insights/contact_center_insights_extension_manager.h"
#include "chrome/browser/chromeos/extensions/desk_api/desk_api_extension_manager.h"
#endif
#if BUILDFLAG(ENABLE_BOUND_SESSION_CREDENTIALS)
#include "chrome/browser/signin/bound_session_credentials/bound_session_cookie_refresh_service_factory.h"
#endif
BrowserThread;
namespace {
void SetCrashKeysForAsyncProfileCreation(Profile* profile,
bool creation_complete) { … }
void CaptureProfile(base::WeakPtr<Profile>* captured_profile,
base::OnceClosure closure,
Profile* profile) { … }
int64_t ComputeFilesSize(const base::FilePath& directory,
const base::FilePath::StringType& pattern) { … }
void ProfileSizeTask(const base::FilePath& path, int enabled_app_count) { … }
#if BUILDFLAG(ENABLE_EXTENSIONS)
size_t GetEnabledAppCount(Profile* profile) { … }
#endif
void OnProfileInitialized(ProfileManager::ProfileLoadedCallback client_callback,
bool incognito,
Profile* profile) { … }
bool IsRegisteredAsEphemeral(ProfileAttributesStorage* storage,
const base::FilePath& profile_dir) { … }
#if BUILDFLAG(IS_CHROMEOS_ASH)
bool IsLoggedIn() {
return user_manager::UserManager::IsInitialized() &&
user_manager::UserManager::Get()->IsUserLoggedIn();
}
#endif
bool IsForceEphemeralProfilesEnabled(Profile* profile) { … }
int GetTotalRefCount(const std::map<ProfileKeepAliveOrigin, int>& keep_alives) { … }
std::ostream& operator<<(
std::ostream& out,
const std::map<ProfileKeepAliveOrigin, int>& keep_alives) { … }
#if BUILDFLAG(IS_CHROMEOS)
void UpdateSupervisedUserPref(Profile* profile, bool is_child) {
DCHECK(profile);
if (is_child) {
profile->GetPrefs()->SetString(prefs::kSupervisedUserId,
supervised_user::kChildAccountSUID);
} else {
profile->GetPrefs()->ClearPref(prefs::kSupervisedUserId);
}
}
std::optional<bool> IsUserChild(Profile* profile) {
#if BUILDFLAG(IS_CHROMEOS_ASH)
const user_manager::User* user =
ash::ProfileHelper::Get()->GetUserByProfile(profile);
return user ? std::make_optional(user->GetType() ==
user_manager::UserType::kChild)
: std::nullopt;
#elif BUILDFLAG(IS_CHROMEOS_LACROS)
return chromeos::BrowserParamsProxy::Get()->SessionType() ==
crosapi::mojom::SessionType::kChildSession;
#endif
}
#endif
void RunCallbacks(std::vector<base::OnceCallback<void(Profile*)>>& callbacks,
Profile* profile) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
void ClearPrimaryAccountForProfile(
base::WeakPtr<Profile> weak_profile,
signin_metrics::ProfileSignout signout_source_metric) { … }
#endif
}
ProfileManager::ProfileManager(const base::FilePath& user_data_dir)
: … { … }
ProfileManager::~ProfileManager() { … }
#if BUILDFLAG(ENABLE_SESSION_SERVICE)
void ProfileManager::ShutdownSessionServices() { … }
#endif
Profile* ProfileManager::GetLastUsedProfile() { … }
Profile* ProfileManager::GetLastUsedProfileIfLoaded() { … }
Profile* ProfileManager::GetLastUsedProfileAllowedByPolicy() { … }
Profile* ProfileManager::MaybeForceOffTheRecordMode(Profile* profile) { … }
std::vector<Profile*> ProfileManager::GetLastOpenedProfiles() { … }
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
Profile* ProfileManager::GetPrimaryUserProfile() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (IsLoggedIn()) {
user_manager::UserManager* manager = user_manager::UserManager::Get();
const user_manager::User* user = manager->GetPrimaryUser();
if (!user)
return nullptr;
if (user->is_profile_created()) {
return ash::ProfileHelper::Get()->GetProfileByUser(user);
}
LOG(ERROR) << "ProfileManager::GetPrimaryUserProfile is called when "
"|user| is created but |user|'s profile is not yet created. "
"It probably means that something is wrong with a calling "
"code. Please report in http://crbug.com/361528 if you see "
"this message.";
if (base::SysInfo::IsRunningOnChromeOS()) {
base::UmaHistogramBoolean(
"Ash.BrowserContext.UnexpectedGetPrimaryUserProfile", true);
base::debug::DumpWithoutCrashing();
}
Profile* profile = ProfileManager::GetActiveUserProfile();
if (profile && manager->IsLoggedInAsGuest())
profile = profile->GetPrimaryOTRProfile(true);
return profile;
}
#endif
ProfileManager* profile_manager = g_browser_process->profile_manager();
if (!profile_manager)
return nullptr;
return profile_manager->GetActiveUserOrOffTheRecordProfile();
}
Profile* ProfileManager::GetActiveUserProfile() {
ProfileManager* profile_manager = g_browser_process->profile_manager();
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (!profile_manager)
return nullptr;
if (IsLoggedIn()) {
user_manager::UserManager* manager = user_manager::UserManager::Get();
const user_manager::User* user = manager->GetActiveUser();
if (user && user->is_profile_created())
return ash::ProfileHelper::Get()->GetProfileByUser(user);
}
#endif
Profile* profile = profile_manager->GetActiveUserOrOffTheRecordProfile();
CHECK(profile) << profile_manager->user_data_dir().AsUTF8Unsafe();
return profile;
}
#endif
#if BUILDFLAG(IS_CHROMEOS_ASH) || BUILDFLAG(IS_ANDROID)
Profile* ProfileManager::CreateInitialProfile() {
ProfileManager* const profile_manager = g_browser_process->profile_manager();
Profile* profile =
profile_manager->GetProfile(profile_manager->user_data_dir().Append(
profile_manager->GetInitialProfileDir()));
if (profile_manager->ShouldGoOffTheRecord(profile))
return profile->GetPrimaryOTRProfile(true);
return profile;
}
#endif
void ProfileManager::AddObserver(ProfileManagerObserver* observer) { … }
void ProfileManager::RemoveObserver(ProfileManagerObserver* observer) { … }
Profile* ProfileManager::GetProfile(const base::FilePath& profile_dir) { … }
size_t ProfileManager::GetNumberOfProfiles() { … }
bool ProfileManager::LoadProfile(const base::FilePath& profile_base_name,
bool incognito,
ProfileLoadedCallback callback) { … }
bool ProfileManager::LoadProfileByPath(const base::FilePath& profile_path,
bool incognito,
ProfileLoadedCallback callback) { … }
void ProfileManager::CreateProfileAsync(
const base::FilePath& profile_path,
base::OnceCallback<void(Profile*)> initialized_callback,
base::OnceCallback<void(Profile*)> created_callback) { … }
bool ProfileManager::IsValidProfile(const void* profile) { … }
base::FilePath ProfileManager::GetInitialProfileDir() { … }
base::FilePath ProfileManager::GetLastUsedProfileDir() { … }
base::FilePath ProfileManager::GetLastUsedProfileBaseName() { … }
base::FilePath ProfileManager::GetProfileDirForEmail(const std::string& email) { … }
std::vector<Profile*> ProfileManager::GetLoadedProfiles() const { … }
Profile* ProfileManager::GetProfileByPathInternal(
const base::FilePath& path) const { … }
bool ProfileManager::IsAllowedProfilePath(const base::FilePath& path) const { … }
bool ProfileManager::CanCreateProfileAtPath(const base::FilePath& path) const { … }
Profile* ProfileManager::GetProfileByPath(const base::FilePath& path) const { … }
Profile* ProfileManager::GetProfileFromProfileKey(ProfileKey* profile_key) { … }
std::map<ProfileKeepAliveOrigin, int> ProfileManager::GetKeepAlivesByPath(
const base::FilePath& path) { … }
#if !BUILDFLAG(IS_ANDROID)
void ProfileManager::CreateMultiProfileAsync(
const std::u16string& name,
size_t icon_index,
bool is_hidden,
base::OnceCallback<void(Profile*)> initialized_callback,
base::OnceCallback<void(Profile*)> created_callback) { … }
#endif
base::FilePath ProfileManager::GetGuestProfilePath() { … }
#if !BUILDFLAG(IS_CHROMEOS_ASH) && !BUILDFLAG(IS_ANDROID)
base::FilePath ProfileManager::GetSystemProfilePath() { … }
#endif
#if BUILDFLAG(IS_CHROMEOS_LACROS)
base::FilePath ProfileManager::GetPrimaryUserProfilePath() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
ProfileManager* profile_manager = g_browser_process->profile_manager();
return profile_manager->user_data_dir().Append(
profile_manager->GetInitialProfileDir());
}
#endif
base::FilePath ProfileManager::GenerateNextProfileDirectoryPath() { … }
base::FilePath ProfileManager::GetNextExpectedProfileDirectoryPath() { … }
ProfileAttributesStorage& ProfileManager::GetProfileAttributesStorage() { … }
ProfileShortcutManager* ProfileManager::profile_shortcut_manager() { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
AccountProfileMapper* ProfileManager::GetAccountProfileMapper() {
if (!account_profile_mapper_) {
account_profile_mapper_ = std::make_unique<AccountProfileMapper>(
GetAccountManagerFacade(std::string()),
&GetProfileAttributesStorage(), g_browser_process->local_state());
}
return account_profile_mapper_.get();
}
#endif
void ProfileManager::AutoloadProfiles() { … }
void ProfileManager::InitProfileUserPrefs(Profile* profile) { … }
void ProfileManager::RegisterTestingProfile(std::unique_ptr<Profile> profile,
bool add_to_storage) { … }
std::unique_ptr<Profile> ProfileManager::CreateProfileHelper(
const base::FilePath& path) { … }
std::unique_ptr<Profile> ProfileManager::CreateProfileAsyncHelper(
const base::FilePath& path) { … }
bool ProfileManager::HasKeepAliveForTesting(const Profile* profile,
ProfileKeepAliveOrigin origin) { … }
#if BUILDFLAG(IS_CHROMEOS_LACROS)
void ProfileManager::SetAccountProfileMapperForTests(
std::unique_ptr<AccountProfileMapper> mapper) {
DCHECK(!account_profile_mapper_)
<< "AccountProfileMapper must be set before the first usage";
account_profile_mapper_ = std::move(mapper);
}
#endif
void ProfileManager::DisableProfileMetricsForTesting() { … }
size_t ProfileManager::GetZombieProfileCount() const { … }
void ProfileManager::RecordZombieMetrics() { … }
void ProfileManager::AddKeepAlive(const Profile* profile,
ProfileKeepAliveOrigin origin) { … }
void ProfileManager::RemoveKeepAlive(const Profile* profile,
ProfileKeepAliveOrigin origin) { … }
void ProfileManager::ClearFirstBrowserWindowKeepAlive(const Profile* profile) { … }
void ProfileManager::NotifyOnProfileMarkedForPermanentDeletion(
Profile* profile) { … }
void ProfileManager::UnloadProfileIfNoKeepAlive(const ProfileInfo* info) { … }
void ProfileManager::DoFinalInit(ProfileInfo* profile_info,
bool go_off_the_record) { … }
void ProfileManager::DoFinalInitForServices(Profile* profile,
bool go_off_the_record) { … }
void ProfileManager::DoFinalInitLogging(Profile* profile) { … }
ProfileManager::ProfileInfo::ProfileInfo() { … }
ProfileManager::ProfileInfo::~ProfileInfo() { … }
std::unique_ptr<ProfileManager::ProfileInfo>
ProfileManager::ProfileInfo::FromUnownedProfile(Profile* profile) { … }
void ProfileManager::ProfileInfo::TakeOwnershipOfProfile(
std::unique_ptr<Profile> profile) { … }
void ProfileManager::ProfileInfo::MarkProfileAsCreated(Profile* profile) { … }
Profile* ProfileManager::ProfileInfo::GetCreatedProfile() const { … }
Profile* ProfileManager::ProfileInfo::GetRawProfile() const { … }
#if BUILDFLAG(IS_CHROMEOS) || BUILDFLAG(IS_ANDROID)
Profile* ProfileManager::GetActiveUserOrOffTheRecordProfile() {
#if BUILDFLAG(IS_CHROMEOS_ASH)
if (!IsLoggedIn()) {
base::FilePath default_profile_dir =
profiles::GetDefaultProfileDir(user_data_dir_);
Profile* profile = GetProfile(default_profile_dir);
if (ShouldGoOffTheRecord(profile))
return profile->GetPrimaryOTRProfile(true);
DCHECK(!user_manager::UserManager::Get()->IsLoggedInAsGuest());
return profile;
}
base::FilePath default_profile_dir =
user_data_dir_.Append(GetInitialProfileDir());
ProfileInfo* profile_info = GetProfileInfoByPath(default_profile_dir);
if (!profile_info || !profile_info->GetCreatedProfile())
default_profile_dir = profiles::GetDefaultProfileDir(user_data_dir_);
Profile* profile = GetProfile(default_profile_dir);
if (user_manager::UserManager::IsInitialized() &&
user_manager::UserManager::Get()->IsLoggedInAsGuest())
return profile->GetPrimaryOTRProfile(true);
return profile;
#else
base::FilePath default_profile_dir =
user_data_dir_.Append(GetInitialProfileDir());
return GetProfile(default_profile_dir);
#endif
}
#endif
bool ProfileManager::AddProfile(std::unique_ptr<Profile> profile) { … }
#if !BUILDFLAG(IS_ANDROID) && !BUILDFLAG(IS_CHROMEOS_ASH)
void ProfileManager::UnloadProfile(const base::FilePath& profile_dir) { … }
#endif
Profile* ProfileManager::CreateAndInitializeProfile(
const base::FilePath& profile_dir) { … }
void ProfileManager::OnProfileCreationFinished(Profile* profile,
Profile::CreateMode create_mode,
bool success,
bool is_new_profile) { … }
void ProfileManager::OnProfileCreationStarted(Profile* profile,
Profile::CreateMode create_mode) { … }
#if !BUILDFLAG(IS_ANDROID)
std::optional<base::FilePath> ProfileManager::FindLastActiveProfile(
base::RepeatingCallback<bool(ProfileAttributesEntry*)> predicate) { … }
DeleteProfileHelper& ProfileManager::GetDeleteProfileHelper() { … }
#endif
ProfileManager::ProfileInfo* ProfileManager::RegisterOwnedProfile(
std::unique_ptr<Profile> profile) { … }
ProfileManager::ProfileInfo* ProfileManager::RegisterUnownedProfile(
Profile* profile) { … }
ProfileManager::ProfileInfo* ProfileManager::GetProfileInfoByPath(
const base::FilePath& path) const { … }
void ProfileManager::AddProfileToStorage(Profile* profile) { … }
void ProfileManager::SetNonPersonalProfilePrefs(Profile* profile) { … }
bool ProfileManager::ShouldGoOffTheRecord(Profile* profile) { … }
void ProfileManager::SaveActiveProfiles() { … }
void ProfileManager::SetProfileAsLastUsed(Profile* last_active) { … }
#if !BUILDFLAG(IS_ANDROID)
void ProfileManager::OnBrowserOpened(Browser* browser) { … }
void ProfileManager::OnBrowserClosed(Browser* browser) { … }
ProfileManager::BrowserListObserver::BrowserListObserver(
ProfileManager* manager)
: … { … }
ProfileManager::BrowserListObserver::~BrowserListObserver() { … }
void ProfileManager::BrowserListObserver::OnBrowserAdded(Browser* browser) { … }
void ProfileManager::BrowserListObserver::OnBrowserRemoved(Browser* browser) { … }
void ProfileManager::BrowserListObserver::OnBrowserSetLastActive(
Browser* browser) { … }
void ProfileManager::OnClosingAllBrowsersChanged(bool closing) { … }
#endif
ProfileManagerWithoutInit::ProfileManagerWithoutInit(
const base::FilePath& user_data_dir)
: … { … }