Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(590)

Side by Side Diff: chrome/browser/profiles/profile_manager.cc

Issue 9959040: Reland 125805 - Reland 124817 - A profile-keyed service for Extensions, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/extensions/default_apps_trial.h" 19 #include "chrome/browser/extensions/default_apps_trial.h"
20 #include "chrome/browser/extensions/extension_service.h" 20 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/extension_system.h"
22 #include "chrome/browser/extensions/extension_system_factory.h"
21 #include "chrome/browser/managed_mode.h" 23 #include "chrome/browser/managed_mode.h"
22 #include "chrome/browser/prefs/pref_service.h" 24 #include "chrome/browser/prefs/pref_service.h"
23 #include "chrome/browser/prefs/scoped_user_pref_update.h" 25 #include "chrome/browser/prefs/scoped_user_pref_update.h"
24 #include "chrome/browser/profiles/profile_info_cache.h" 26 #include "chrome/browser/profiles/profile_info_cache.h"
25 #include "chrome/browser/profiles/profile_metrics.h" 27 #include "chrome/browser/profiles/profile_metrics.h"
26 #include "chrome/browser/sessions/session_service_factory.h" 28 #include "chrome/browser/sessions/session_service_factory.h"
27 #include "chrome/browser/sync/profile_sync_service.h" 29 #include "chrome/browser/sync/profile_sync_service.h"
28 #include "chrome/browser/sync/profile_sync_service_factory.h" 30 #include "chrome/browser/sync/profile_sync_service_factory.h"
29 #include "chrome/browser/ui/browser.h" 31 #include "chrome/browser/ui/browser.h"
30 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
(...skipping 599 matching lines...) Expand 10 before | Expand all | Expand 10 after
630 632
631 ProfileMetrics::LogNumberOfProfiles(this, ProfileMetrics::ADD_PROFILE_EVENT); 633 ProfileMetrics::LogNumberOfProfiles(this, ProfileMetrics::ADD_PROFILE_EVENT);
632 content::NotificationService::current()->Notify( 634 content::NotificationService::current()->Notify(
633 chrome::NOTIFICATION_PROFILE_ADDED, 635 chrome::NOTIFICATION_PROFILE_ADDED,
634 content::Source<Profile>(profile), 636 content::Source<Profile>(profile),
635 content::NotificationService::NoDetails()); 637 content::NotificationService::NoDetails());
636 638
637 } 639 }
638 640
639 void ProfileManager::DoFinalInitForServices(Profile* profile, 641 void ProfileManager::DoFinalInitForServices(Profile* profile,
640 bool go_off_the_record) { 642 bool go_off_the_record) {
641 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 643 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
642 profile->InitExtensions(!go_off_the_record); 644 ExtensionSystemFactory::GetForProfile(profile)->Init(!go_off_the_record);
643 if (!command_line.HasSwitch(switches::kDisableWebResources)) 645 if (!command_line.HasSwitch(switches::kDisableWebResources))
644 profile->InitPromoResources(); 646 profile->InitPromoResources();
645 } 647 }
646 648
647 void ProfileManager::DoFinalInitLogging(Profile* profile) { 649 void ProfileManager::DoFinalInitLogging(Profile* profile) {
648 // Count number of extensions in this profile. 650 // Count number of extensions in this profile.
649 int extension_count = -1; 651 int extension_count = -1;
650 ExtensionService* extension_service = profile->GetExtensionService(); 652 ExtensionService* extension_service = profile->GetExtensionService();
651 if (extension_service) 653 if (extension_service)
652 extension_count = extension_service->GetAppIds().size(); 654 extension_count = extension_service->GetAppIds().size();
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
963 AddProfileToCache(profile); 965 AddProfileToCache(profile);
964 } 966 }
965 } 967 }
966 968
967 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, 969 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
968 Profile* profile, 970 Profile* profile,
969 Profile::CreateStatus status) { 971 Profile::CreateStatus status) {
970 for (size_t i = 0; i < callbacks.size(); ++i) 972 for (size_t i = 0; i < callbacks.size(); ++i)
971 callbacks[i].Run(profile, status); 973 callbacks[i].Run(profile, status);
972 } 974 }
OLDNEW
« no previous file with comments | « chrome/browser/profiles/profile_io_data.cc ('k') | chrome/browser/renderer_host/chrome_render_message_filter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698