| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/profiles/profile_manager.h" | 5 #include "chrome/browser/profiles/profile_manager.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include <map> | 9 #include <map> |
| 10 #include <set> | 10 #include <set> |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 #include "chrome/browser/signin/cross_device_promo_factory.h" | 52 #include "chrome/browser/signin/cross_device_promo_factory.h" |
| 53 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" | 53 #include "chrome/browser/signin/gaia_cookie_manager_service_factory.h" |
| 54 #include "chrome/browser/signin/signin_manager_factory.h" | 54 #include "chrome/browser/signin/signin_manager_factory.h" |
| 55 #include "chrome/browser/sync/profile_sync_service_factory.h" | 55 #include "chrome/browser/sync/profile_sync_service_factory.h" |
| 56 #include "chrome/browser/ui/browser.h" | 56 #include "chrome/browser/ui/browser.h" |
| 57 #include "chrome/browser/ui/browser_list.h" | 57 #include "chrome/browser/ui/browser_list.h" |
| 58 #include "chrome/browser/ui/sync/sync_promo_ui.h" | 58 #include "chrome/browser/ui/sync/sync_promo_ui.h" |
| 59 #include "chrome/common/chrome_constants.h" | 59 #include "chrome/common/chrome_constants.h" |
| 60 #include "chrome/common/chrome_paths_internal.h" | 60 #include "chrome/common/chrome_paths_internal.h" |
| 61 #include "chrome/common/chrome_switches.h" | 61 #include "chrome/common/chrome_switches.h" |
| 62 #include "chrome/common/features.h" |
| 62 #include "chrome/common/logging_chrome.h" | 63 #include "chrome/common/logging_chrome.h" |
| 63 #include "chrome/common/pref_names.h" | 64 #include "chrome/common/pref_names.h" |
| 64 #include "chrome/common/url_constants.h" | 65 #include "chrome/common/url_constants.h" |
| 65 #include "chrome/grit/generated_resources.h" | 66 #include "chrome/grit/generated_resources.h" |
| 66 #include "components/bookmarks/browser/bookmark_model.h" | 67 #include "components/bookmarks/browser/bookmark_model.h" |
| 67 #include "components/bookmarks/browser/startup_task_runner_service.h" | 68 #include "components/bookmarks/browser/startup_task_runner_service.h" |
| 68 #include "components/bookmarks/common/bookmark_pref_names.h" | 69 #include "components/bookmarks/common/bookmark_pref_names.h" |
| 69 #include "components/browser_sync/profile_sync_service.h" | 70 #include "components/browser_sync/profile_sync_service.h" |
| 70 #include "components/content_settings/core/browser/host_content_settings_map.h" | 71 #include "components/content_settings/core/browser/host_content_settings_map.h" |
| 71 #include "components/invalidation/impl/profile_invalidation_provider.h" | 72 #include "components/invalidation/impl/profile_invalidation_provider.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 93 #include "ui/base/l10n/l10n_util.h" | 94 #include "ui/base/l10n/l10n_util.h" |
| 94 | 95 |
| 95 #if defined(ENABLE_EXTENSIONS) | 96 #if defined(ENABLE_EXTENSIONS) |
| 96 #include "chrome/browser/extensions/extension_service.h" | 97 #include "chrome/browser/extensions/extension_service.h" |
| 97 #include "extensions/browser/extension_registry.h" | 98 #include "extensions/browser/extension_registry.h" |
| 98 #include "extensions/browser/extension_system.h" | 99 #include "extensions/browser/extension_system.h" |
| 99 #include "extensions/common/extension_set.h" | 100 #include "extensions/common/extension_set.h" |
| 100 #include "extensions/common/manifest.h" | 101 #include "extensions/common/manifest.h" |
| 101 #endif | 102 #endif |
| 102 | 103 |
| 103 #if defined(ENABLE_SUPERVISED_USERS) | 104 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 104 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" | 105 #include "chrome/browser/supervised_user/child_accounts/child_account_service.h" |
| 105 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" | 106 #include "chrome/browser/supervised_user/child_accounts/child_account_service_fa
ctory.h" |
| 106 #include "chrome/browser/supervised_user/supervised_user_service.h" | 107 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 107 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 108 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 108 #endif | 109 #endif |
| 109 | 110 |
| 110 #if defined(OS_ANDROID) | 111 #if defined(OS_ANDROID) |
| 111 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" | 112 #include "chrome/browser/ntp_snippets/content_suggestions_service_factory.h" |
| 112 #endif | 113 #endif |
| 113 | 114 |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 content::NotificationService::AllSources()); | 344 content::NotificationService::AllSources()); |
| 344 | 345 |
| 345 if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty()) | 346 if (ProfileShortcutManager::IsFeatureEnabled() && !user_data_dir_.empty()) |
| 346 profile_shortcut_manager_.reset(ProfileShortcutManager::Create( | 347 profile_shortcut_manager_.reset(ProfileShortcutManager::Create( |
| 347 this)); | 348 this)); |
| 348 } | 349 } |
| 349 | 350 |
| 350 ProfileManager::~ProfileManager() { | 351 ProfileManager::~ProfileManager() { |
| 351 } | 352 } |
| 352 | 353 |
| 353 #if defined(ENABLE_SESSION_SERVICE) | 354 #if BUILDFLAG(ENABLE_SESSION_SERVICE) |
| 354 // static | 355 // static |
| 355 void ProfileManager::ShutdownSessionServices() { | 356 void ProfileManager::ShutdownSessionServices() { |
| 356 ProfileManager* pm = g_browser_process->profile_manager(); | 357 ProfileManager* pm = g_browser_process->profile_manager(); |
| 357 if (!pm) // Is NULL when running unit tests. | 358 if (!pm) // Is NULL when running unit tests. |
| 358 return; | 359 return; |
| 359 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); | 360 std::vector<Profile*> profiles(pm->GetLoadedProfiles()); |
| 360 for (size_t i = 0; i < profiles.size(); ++i) | 361 for (size_t i = 0; i < profiles.size(); ++i) |
| 361 SessionServiceFactory::ShutdownForProfile(profiles[i]); | 362 SessionServiceFactory::ShutdownForProfile(profiles[i]); |
| 362 } | 363 } |
| 363 #endif | 364 #endif |
| (...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1148 ProfileAttributesEntry* entry; | 1149 ProfileAttributesEntry* entry; |
| 1149 bool has_entry = GetProfileAttributesStorage(). | 1150 bool has_entry = GetProfileAttributesStorage(). |
| 1150 GetProfileAttributesWithPath(profile->GetPath(), &entry); | 1151 GetProfileAttributesWithPath(profile->GetPath(), &entry); |
| 1151 if (has_entry && entry->IsSigninRequired()) { | 1152 if (has_entry && entry->IsSigninRequired()) { |
| 1152 extensions::ExtensionSystem::Get(profile) | 1153 extensions::ExtensionSystem::Get(profile) |
| 1153 ->extension_service() | 1154 ->extension_service() |
| 1154 ->BlockAllExtensions(); | 1155 ->BlockAllExtensions(); |
| 1155 } | 1156 } |
| 1156 | 1157 |
| 1157 #endif | 1158 #endif |
| 1158 #if defined(ENABLE_SUPERVISED_USERS) | 1159 #if BUILDFLAG(ENABLE_SUPERVISED_USERS) |
| 1159 // Initialization needs to happen after extension system initialization (for | 1160 // Initialization needs to happen after extension system initialization (for |
| 1160 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the | 1161 // extension::ManagementPolicy) and InitProfileUserPrefs (for setting the |
| 1161 // initializing the supervised flag if necessary). | 1162 // initializing the supervised flag if necessary). |
| 1162 ChildAccountServiceFactory::GetForProfile(profile)->Init(); | 1163 ChildAccountServiceFactory::GetForProfile(profile)->Init(); |
| 1163 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); | 1164 SupervisedUserServiceFactory::GetForProfile(profile)->Init(); |
| 1164 #endif | 1165 #endif |
| 1165 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) | 1166 #if !defined(OS_ANDROID) && !defined(OS_CHROMEOS) |
| 1166 // If the lock enabled algorithm changed, update this profile's lock status. | 1167 // If the lock enabled algorithm changed, update this profile's lock status. |
| 1167 // This depends on services which shouldn't be initialized until | 1168 // This depends on services which shouldn't be initialized until |
| 1168 // DoFinalInitForServices. | 1169 // DoFinalInitForServices. |
| (...skipping 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 | 1668 |
| 1668 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); | 1669 FinishDeletingProfile(profile_to_delete_path, new_active_profile_path); |
| 1669 if (!original_callback.is_null()) | 1670 if (!original_callback.is_null()) |
| 1670 original_callback.Run(loaded_profile, status); | 1671 original_callback.Run(loaded_profile, status); |
| 1671 } | 1672 } |
| 1672 #endif // !defined(OS_ANDROID) | 1673 #endif // !defined(OS_ANDROID) |
| 1673 | 1674 |
| 1674 ProfileManagerWithoutInit::ProfileManagerWithoutInit( | 1675 ProfileManagerWithoutInit::ProfileManagerWithoutInit( |
| 1675 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { | 1676 const base::FilePath& user_data_dir) : ProfileManager(user_data_dir) { |
| 1676 } | 1677 } |
| OLD | NEW |