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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 7717025: Do not initialize event routers in the Profile Import process. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: reset will_import_ value when import complete. Created 9 years, 4 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
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 652 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 // profile is in the process of being deleted. 663 // profile is in the process of being deleted.
664 664
665 ProviderCollection::const_iterator i; 665 ProviderCollection::const_iterator i;
666 for (i = external_extension_providers_.begin(); 666 for (i = external_extension_providers_.begin();
667 i != external_extension_providers_.end(); ++i) { 667 i != external_extension_providers_.end(); ++i) {
668 ExternalExtensionProviderInterface* provider = i->get(); 668 ExternalExtensionProviderInterface* provider = i->get();
669 provider->ServiceShutdown(); 669 provider->ServiceShutdown();
670 } 670 }
671 } 671 }
672 672
673 void ExtensionService::InitEventRoutersAfterImport() {
674 registrar_.Add(this, chrome::NOTIFICATION_IMPORT_FINISHED,
675 Source<Profile>(profile_));
676 }
677
673 void ExtensionService::InitEventRouters() { 678 void ExtensionService::InitEventRouters() {
674 if (event_routers_initialized_) 679 if (event_routers_initialized_)
675 return; 680 return;
676 681
677 history_event_router_.reset(new ExtensionHistoryEventRouter()); 682 history_event_router_.reset(new ExtensionHistoryEventRouter());
678 history_event_router_->ObserveProfile(profile_); 683 history_event_router_->ObserveProfile(profile_);
679 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_); 684 ExtensionAccessibilityEventRouter::GetInstance()->ObserveProfile(profile_);
680 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_)); 685 browser_event_router_.reset(new ExtensionBrowserEventRouter(profile_));
681 browser_event_router_->Init(); 686 browser_event_router_->Init();
682 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_)); 687 preference_event_router_.reset(new ExtensionPreferenceEventRouter(profile_));
(...skipping 2000 matching lines...) Expand 10 before | Expand all | Expand 10 after
2683 case chrome::NOTIFICATION_PREF_CHANGED: { 2688 case chrome::NOTIFICATION_PREF_CHANGED: {
2684 std::string* pref_name = Details<std::string>(details).ptr(); 2689 std::string* pref_name = Details<std::string>(details).ptr();
2685 if (*pref_name == prefs::kExtensionInstallAllowList || 2690 if (*pref_name == prefs::kExtensionInstallAllowList ||
2686 *pref_name == prefs::kExtensionInstallDenyList) { 2691 *pref_name == prefs::kExtensionInstallDenyList) {
2687 CheckAdminBlacklist(); 2692 CheckAdminBlacklist();
2688 } else { 2693 } else {
2689 NOTREACHED() << "Unexpected preference name."; 2694 NOTREACHED() << "Unexpected preference name.";
2690 } 2695 }
2691 break; 2696 break;
2692 } 2697 }
2698 case chrome::NOTIFICATION_IMPORT_FINISHED: {
2699 registrar_.Remove(this, chrome::NOTIFICATION_IMPORT_FINISHED,
2700 Source<Profile>(profile_));
2701 InitEventRouters();
2702 break;
2703 }
2693 2704
2694 default: 2705 default:
2695 NOTREACHED() << "Unexpected notification type."; 2706 NOTREACHED() << "Unexpected notification type.";
2696 } 2707 }
2697 } 2708 }
2698 2709
2699 bool ExtensionService::HasApps() const { 2710 bool ExtensionService::HasApps() const {
2700 return !GetAppIds().empty(); 2711 return !GetAppIds().empty();
2701 } 2712 }
2702 2713
(...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after
2812 2823
2813 ExtensionService::NaClModuleInfoList::iterator 2824 ExtensionService::NaClModuleInfoList::iterator
2814 ExtensionService::FindNaClModule(const GURL& url) { 2825 ExtensionService::FindNaClModule(const GURL& url) {
2815 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin(); 2826 for (NaClModuleInfoList::iterator iter = nacl_module_list_.begin();
2816 iter != nacl_module_list_.end(); ++iter) { 2827 iter != nacl_module_list_.end(); ++iter) {
2817 if (iter->url == url) 2828 if (iter->url == url)
2818 return iter; 2829 return iter;
2819 } 2830 }
2820 return nacl_module_list_.end(); 2831 return nacl_module_list_.end();
2821 } 2832 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_service.h ('k') | chrome/browser/profiles/profile_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698