| 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 <set> | 5 #include <set> |
| 6 | 6 |
| 7 #include "chrome/browser/profiles/profile_manager.h" | 7 #include "chrome/browser/profiles/profile_manager.h" |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| 11 #include "base/file_path.h" | 11 #include "base/file_path.h" |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/metrics/field_trial.h" | 13 #include "base/metrics/field_trial.h" |
| 14 #include "base/metrics/histogram.h" | 14 #include "base/metrics/histogram.h" |
| 15 #include "base/string_number_conversions.h" | 15 #include "base/string_number_conversions.h" |
| 16 #include "base/string_util.h" | 16 #include "base/string_util.h" |
| 17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/content_settings/host_content_settings_map.h" |
| 19 #include "chrome/browser/extensions/default_apps_trial.h" | 20 #include "chrome/browser/extensions/default_apps_trial.h" |
| 20 #include "chrome/browser/extensions/extension_service.h" | 21 #include "chrome/browser/extensions/extension_service.h" |
| 21 #include "chrome/browser/extensions/extension_system.h" | 22 #include "chrome/browser/extensions/extension_system.h" |
| 22 #include "chrome/browser/managed_mode.h" | 23 #include "chrome/browser/managed_mode.h" |
| 23 #include "chrome/browser/prefs/pref_service.h" | 24 #include "chrome/browser/prefs/pref_service.h" |
| 24 #include "chrome/browser/prefs/scoped_user_pref_update.h" | 25 #include "chrome/browser/prefs/scoped_user_pref_update.h" |
| 25 #include "chrome/browser/profiles/profile_destroyer.h" | 26 #include "chrome/browser/profiles/profile_destroyer.h" |
| 26 #include "chrome/browser/profiles/profile_info_cache.h" | 27 #include "chrome/browser/profiles/profile_info_cache.h" |
| 27 #include "chrome/browser/profiles/profile_metrics.h" | 28 #include "chrome/browser/profiles/profile_metrics.h" |
| 28 #include "chrome/browser/sessions/session_service_factory.h" | 29 #include "chrome/browser/sessions/session_service_factory.h" |
| (...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 chrome::NOTIFICATION_PROFILE_ADDED, | 641 chrome::NOTIFICATION_PROFILE_ADDED, |
| 641 content::Source<Profile>(profile), | 642 content::Source<Profile>(profile), |
| 642 content::NotificationService::NoDetails()); | 643 content::NotificationService::NoDetails()); |
| 643 | 644 |
| 644 } | 645 } |
| 645 | 646 |
| 646 void ProfileManager::DoFinalInitForServices(Profile* profile, | 647 void ProfileManager::DoFinalInitForServices(Profile* profile, |
| 647 bool go_off_the_record) { | 648 bool go_off_the_record) { |
| 648 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 649 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| 649 ExtensionSystem::Get(profile)->Init(!go_off_the_record); | 650 ExtensionSystem::Get(profile)->Init(!go_off_the_record); |
| 651 profile->GetHostContentSettingsMap()->RegisterExtensionService( |
| 652 ExtensionSystem::Get(profile)->extension_service()); |
| 650 if (!command_line.HasSwitch(switches::kDisableWebResources)) | 653 if (!command_line.HasSwitch(switches::kDisableWebResources)) |
| 651 profile->InitPromoResources(); | 654 profile->InitPromoResources(); |
| 652 } | 655 } |
| 653 | 656 |
| 654 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 657 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
| 655 // Count number of extensions in this profile. | 658 // Count number of extensions in this profile. |
| 656 int extension_count = -1; | 659 int extension_count = -1; |
| 657 ExtensionService* extension_service = profile->GetExtensionService(); | 660 ExtensionService* extension_service = profile->GetExtensionService(); |
| 658 if (extension_service) | 661 if (extension_service) |
| 659 extension_count = extension_service->GetAppIds().size(); | 662 extension_count = extension_service->GetAppIds().size(); |
| (...skipping 314 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 974 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, | 977 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, |
| 975 Profile* profile, | 978 Profile* profile, |
| 976 Profile::CreateStatus status) { | 979 Profile::CreateStatus status) { |
| 977 for (size_t i = 0; i < callbacks.size(); ++i) | 980 for (size_t i = 0; i < callbacks.size(); ++i) |
| 978 callbacks[i].Run(profile, status); | 981 callbacks[i].Run(profile, status); |
| 979 } | 982 } |
| 980 | 983 |
| 981 ProfileManager::ProfileInfo::~ProfileInfo() { | 984 ProfileManager::ProfileInfo::~ProfileInfo() { |
| 982 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 985 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
| 983 } | 986 } |
| OLD | NEW |