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

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

Issue 11496004: Lazy initialization for PushMessagingEventRouter (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: nit fixed Created 8 years 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
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 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
7 7
8 #include <list> 8 #include <list>
9 #include <map> 9 #include <map>
10 #include <set> 10 #include <set>
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 class BrowserEventRouter; 64 class BrowserEventRouter;
65 class ComponentLoader; 65 class ComponentLoader;
66 class ContentSettingsStore; 66 class ContentSettingsStore;
67 class CrxInstaller; 67 class CrxInstaller;
68 class Extension; 68 class Extension;
69 class ExtensionActionStorageManager; 69 class ExtensionActionStorageManager;
70 class ExtensionSyncData; 70 class ExtensionSyncData;
71 class ExtensionSystem; 71 class ExtensionSystem;
72 class ExtensionUpdater; 72 class ExtensionUpdater;
73 class PendingExtensionManager; 73 class PendingExtensionManager;
74 class PushMessagingEventRouter;
75 class SettingsFrontend; 74 class SettingsFrontend;
76 } 75 }
77 76
78 namespace syncer { 77 namespace syncer {
79 class SyncErrorFactory; 78 class SyncErrorFactory;
80 } 79 }
81 80
82 // This is an interface class to encapsulate the dependencies that 81 // This is an interface class to encapsulate the dependencies that
83 // various classes have on ExtensionService. This allows easy mocking. 82 // various classes have on ExtensionService. This allows easy mocking.
84 class ExtensionServiceInterface : public syncer::SyncableService { 83 class ExtensionServiceInterface : public syncer::SyncableService {
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 // TODO(yoz): remove InitEventRoutersAterImport. 282 // TODO(yoz): remove InitEventRoutersAterImport.
284 void InitEventRoutersAfterImport(); 283 void InitEventRoutersAfterImport();
285 void RegisterForImportFinished(); 284 void RegisterForImportFinished();
286 285
287 // Complete some initialization after being notified that import has finished. 286 // Complete some initialization after being notified that import has finished.
288 void InitAfterImport(); 287 void InitAfterImport();
289 288
290 // Start up the extension event routers. 289 // Start up the extension event routers.
291 void InitEventRouters(); 290 void InitEventRouters();
292 291
293 // Called when the ProfileSyncService for the associated Profile is
294 // going to be destroyed. This is guaranteed to be called exactly
295 // once before Shutdown() is called.
296 //
297 // TODO(akalin): Remove this once http://crbug.com/153827 is fixed.
298 void OnProfileSyncServiceShutdown();
299
300 // Called when the associated Profile is going to be destroyed. 292 // Called when the associated Profile is going to be destroyed.
301 void Shutdown(); 293 void Shutdown();
302 294
303 // Look up an extension by ID. Does not include terminated 295 // Look up an extension by ID. Does not include terminated
304 // extensions. 296 // extensions.
305 virtual const extensions::Extension* GetExtensionById( 297 virtual const extensions::Extension* GetExtensionById(
306 const std::string& id, bool include_disabled) const OVERRIDE; 298 const std::string& id, bool include_disabled) const OVERRIDE;
307 299
308 enum IncludeFlag { 300 enum IncludeFlag {
309 INCLUDE_NONE = 0, 301 INCLUDE_NONE = 0,
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
561 extensions::BrowserEventRouter* browser_event_router() { 553 extensions::BrowserEventRouter* browser_event_router() {
562 return browser_event_router_.get(); 554 return browser_event_router_.get();
563 } 555 }
564 556
565 #if defined(OS_CHROMEOS) 557 #if defined(OS_CHROMEOS)
566 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() { 558 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() {
567 return input_method_event_router_.get(); 559 return input_method_event_router_.get();
568 } 560 }
569 #endif 561 #endif
570 562
571 extensions::PushMessagingEventRouter* push_messaging_event_router() {
572 return push_messaging_event_router_.get();
573 }
574
575 // Notify the frontend that there was an error loading an extension. 563 // Notify the frontend that there was an error loading an extension.
576 // This method is public because UnpackedInstaller and InstalledLoader 564 // This method is public because UnpackedInstaller and InstalledLoader
577 // can post to here. 565 // can post to here.
578 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency 566 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency
579 // of these classes on ExtensionService. 567 // of these classes on ExtensionService.
580 void ReportExtensionLoadError(const FilePath& extension_path, 568 void ReportExtensionLoadError(const FilePath& extension_path,
581 const std::string& error, 569 const std::string& error,
582 bool be_noisy); 570 bool be_noisy);
583 571
584 // ExtensionHost of background page calls this method right after its render 572 // ExtensionHost of background page calls this method right after its render
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
962 bool event_routers_initialized_; 950 bool event_routers_initialized_;
963 951
964 // TODO(yoz): None of these should be owned by ExtensionService. 952 // TODO(yoz): None of these should be owned by ExtensionService.
965 // crbug.com/159265 953 // crbug.com/159265
966 scoped_ptr<HistoryExtensionEventRouter> history_event_router_; 954 scoped_ptr<HistoryExtensionEventRouter> history_event_router_;
967 955
968 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; 956 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_;
969 957
970 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_; 958 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_;
971 959
972 scoped_ptr<extensions::PushMessagingEventRouter>
973 push_messaging_event_router_;
974
975 #if defined(OS_CHROMEOS) 960 #if defined(OS_CHROMEOS)
976 scoped_ptr<chromeos::ExtensionInputMethodEventRouter> 961 scoped_ptr<chromeos::ExtensionInputMethodEventRouter>
977 input_method_event_router_; 962 input_method_event_router_;
978 #endif 963 #endif
979 964
980 // A collection of external extension providers. Each provider reads 965 // A collection of external extension providers. Each provider reads
981 // a source of external extension information. Examples include the 966 // a source of external extension information. Examples include the
982 // windows registry and external_extensions.json. 967 // windows registry and external_extensions.json.
983 extensions::ProviderCollection external_extension_providers_; 968 extensions::ProviderCollection external_extension_providers_;
984 969
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1022 #endif 1007 #endif
1023 1008
1024 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1009 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1025 InstallAppsWithUnlimtedStorage); 1010 InstallAppsWithUnlimtedStorage);
1026 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1011 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1027 InstallAppsAndCheckStorageProtection); 1012 InstallAppsAndCheckStorageProtection);
1028 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 1013 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
1029 }; 1014 };
1030 1015
1031 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 1016 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/push_messaging/push_messaging_apitest.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698