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

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

Issue 9369013: Take extensions out of Profile into a profile-keyed service, ExtensionSystem. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: no crashy Created 8 years, 10 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/prefs/pref_service.h" 23 #include "chrome/browser/prefs/pref_service.h"
22 #include "chrome/browser/prefs/scoped_user_pref_update.h" 24 #include "chrome/browser/prefs/scoped_user_pref_update.h"
23 #include "chrome/browser/profiles/profile_info_cache.h" 25 #include "chrome/browser/profiles/profile_info_cache.h"
24 #include "chrome/browser/profiles/profile_metrics.h" 26 #include "chrome/browser/profiles/profile_metrics.h"
25 #include "chrome/browser/sessions/session_service_factory.h" 27 #include "chrome/browser/sessions/session_service_factory.h"
26 #include "chrome/browser/sync/profile_sync_service.h" 28 #include "chrome/browser/sync/profile_sync_service.h"
27 #include "chrome/browser/sync/profile_sync_service_factory.h" 29 #include "chrome/browser/sync/profile_sync_service_factory.h"
28 #include "chrome/browser/ui/browser.h" 30 #include "chrome/browser/ui/browser.h"
29 #include "chrome/browser/ui/browser_window.h" 31 #include "chrome/browser/ui/browser_window.h"
30 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h" 32 #include "chrome/browser/ui/webui/sync_promo/sync_promo_ui.h"
(...skipping 540 matching lines...) Expand 10 before | Expand all | Expand 10 after
571 DoFinalInitForServices(profile, go_off_the_record); 573 DoFinalInitForServices(profile, go_off_the_record);
572 InitProfileUserPrefs(profile); 574 InitProfileUserPrefs(profile);
573 AddProfileToCache(profile); 575 AddProfileToCache(profile);
574 DoFinalInitLogging(profile); 576 DoFinalInitLogging(profile);
575 #if defined(OS_WIN) 577 #if defined(OS_WIN)
576 CreateDesktopShortcut(profile); 578 CreateDesktopShortcut(profile);
577 #endif 579 #endif
578 } 580 }
579 581
580 void ProfileManager::DoFinalInitForServices(Profile* profile, 582 void ProfileManager::DoFinalInitForServices(Profile* profile,
581 bool go_off_the_record) { 583 bool go_off_the_record) {
582 const CommandLine& command_line = *CommandLine::ForCurrentProcess(); 584 const CommandLine& command_line = *CommandLine::ForCurrentProcess();
583 profile->InitExtensions(!go_off_the_record); 585 ExtensionSystemFactory::GetForProfile(profile)->Init(!go_off_the_record);
584 if (!command_line.HasSwitch(switches::kDisableWebResources)) 586 if (!command_line.HasSwitch(switches::kDisableWebResources))
585 profile->InitPromoResources(); 587 profile->InitPromoResources();
586 } 588 }
587 589
588 void ProfileManager::DoFinalInitLogging(Profile* profile) { 590 void ProfileManager::DoFinalInitLogging(Profile* profile) {
589 // Count number of extensions in this profile. 591 // Count number of extensions in this profile.
590 int extension_count = -1; 592 int extension_count = -1;
591 ExtensionService* extension_service = profile->GetExtensionService(); 593 ExtensionService* extension_service = profile->GetExtensionService();
592 if (extension_service) 594 if (extension_service)
593 extension_count = extension_service->GetAppIds().size(); 595 extension_count = extension_service->GetAppIds().size();
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
893 AddProfileToCache(profile); 895 AddProfileToCache(profile);
894 } 896 }
895 } 897 }
896 898
897 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks, 899 void ProfileManager::RunCallbacks(const std::vector<CreateCallback>& callbacks,
898 Profile* profile, 900 Profile* profile,
899 Profile::CreateStatus status) { 901 Profile::CreateStatus status) {
900 for (size_t i = 0; i < callbacks.size(); ++i) 902 for (size_t i = 0; i < callbacks.size(); ++i)
901 callbacks[i].Run(profile, status); 903 callbacks[i].Run(profile, status);
902 } 904 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698