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" |
(...skipping 684 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
695 ProfileMetrics::LogNumberOfProfiles(this, ProfileMetrics::ADD_PROFILE_EVENT); | 695 ProfileMetrics::LogNumberOfProfiles(this, ProfileMetrics::ADD_PROFILE_EVENT); |
696 content::NotificationService::current()->Notify( | 696 content::NotificationService::current()->Notify( |
697 chrome::NOTIFICATION_PROFILE_ADDED, | 697 chrome::NOTIFICATION_PROFILE_ADDED, |
698 content::Source<Profile>(profile), | 698 content::Source<Profile>(profile), |
699 content::NotificationService::NoDetails()); | 699 content::NotificationService::NoDetails()); |
700 | 700 |
701 } | 701 } |
702 | 702 |
703 void ProfileManager::DoFinalInitForServices(Profile* profile, | 703 void ProfileManager::DoFinalInitForServices(Profile* profile, |
704 bool go_off_the_record) { | 704 bool go_off_the_record) { |
| 705 #if defined(ENABLE_EXTENSIONS) |
705 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); | 706 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
706 #if defined(ENABLE_EXTENSIONS) | |
707 if (!IsImportProcess(command_line)) { | 707 if (!IsImportProcess(command_line)) { |
708 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( | 708 extensions::ExtensionSystem::Get(profile)->InitForRegularProfile( |
709 !go_off_the_record); | 709 !go_off_the_record); |
710 // During tests, when |profile| is an instance of TestingProfile, | 710 // During tests, when |profile| is an instance of TestingProfile, |
711 // ExtensionSystem might not create an ExtensionService. | 711 // ExtensionSystem might not create an ExtensionService. |
712 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { | 712 if (extensions::ExtensionSystem::Get(profile)->extension_service()) { |
713 profile->GetHostContentSettingsMap()->RegisterExtensionService( | 713 profile->GetHostContentSettingsMap()->RegisterExtensionService( |
714 extensions::ExtensionSystem::Get(profile)->extension_service()); | 714 extensions::ExtensionSystem::Get(profile)->extension_service()); |
715 } | 715 } |
716 } | 716 } |
717 #endif | 717 #endif |
718 if (!command_line.HasSwitch(switches::kDisableWebResources)) | |
719 profile->InitPromoResources(); | |
720 } | 718 } |
721 | 719 |
722 void ProfileManager::DoFinalInitLogging(Profile* profile) { | 720 void ProfileManager::DoFinalInitLogging(Profile* profile) { |
723 // Count number of extensions in this profile. | 721 // Count number of extensions in this profile. |
724 int extension_count = -1; | 722 int extension_count = -1; |
725 #if defined(ENABLE_EXTENSIONS) | 723 #if defined(ENABLE_EXTENSIONS) |
726 ExtensionService* extension_service = profile->GetExtensionService(); | 724 ExtensionService* extension_service = profile->GetExtensionService(); |
727 if (extension_service) | 725 if (extension_service) |
728 extension_count = extension_service->GetAppIds().size(); | 726 extension_count = extension_service->GetAppIds().size(); |
729 #endif | 727 #endif |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1061 ProfileManager::ProfileInfo::ProfileInfo( | 1059 ProfileManager::ProfileInfo::ProfileInfo( |
1062 Profile* profile, | 1060 Profile* profile, |
1063 bool created) | 1061 bool created) |
1064 : profile(profile), | 1062 : profile(profile), |
1065 created(created) { | 1063 created(created) { |
1066 } | 1064 } |
1067 | 1065 |
1068 ProfileManager::ProfileInfo::~ProfileInfo() { | 1066 ProfileManager::ProfileInfo::~ProfileInfo() { |
1069 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); | 1067 ProfileDestroyer::DestroyProfileWhenAppropriate(profile.release()); |
1070 } | 1068 } |
OLD | NEW |