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

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: Added InitializeEventRouter 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 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 MediaGalleriesPrivateEventRouter; 73 class MediaGalleriesPrivateEventRouter;
74 class PendingExtensionManager; 74 class PendingExtensionManager;
75 class PreferenceEventRouter; 75 class PreferenceEventRouter;
76 class PushMessagingEventRouter;
77 class SettingsFrontend; 76 class SettingsFrontend;
78 class WindowEventRouter; 77 class WindowEventRouter;
79 } 78 }
80 79
81 namespace syncer { 80 namespace syncer {
82 class SyncErrorFactory; 81 class SyncErrorFactory;
83 } 82 }
84 83
85 // This is an interface class to encapsulate the dependencies that 84 // This is an interface class to encapsulate the dependencies that
86 // various classes have on ExtensionService. This allows easy mocking. 85 // various classes have on ExtensionService. This allows easy mocking.
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 // TODO(yoz): remove InitEventRoutersAterImport. 285 // TODO(yoz): remove InitEventRoutersAterImport.
287 void InitEventRoutersAfterImport(); 286 void InitEventRoutersAfterImport();
288 void RegisterForImportFinished(); 287 void RegisterForImportFinished();
289 288
290 // Complete some initialization after being notified that import has finished. 289 // Complete some initialization after being notified that import has finished.
291 void InitAfterImport(); 290 void InitAfterImport();
292 291
293 // Start up the extension event routers. 292 // Start up the extension event routers.
294 void InitEventRouters(); 293 void InitEventRouters();
295 294
296 // Called when the ProfileSyncService for the associated Profile is
297 // going to be destroyed. This is guaranteed to be called exactly
298 // once before Shutdown() is called.
299 //
300 // TODO(akalin): Remove this once http://crbug.com/153827 is fixed.
301 void OnProfileSyncServiceShutdown();
302
303 // Called when the associated Profile is going to be destroyed. 295 // Called when the associated Profile is going to be destroyed.
304 void Shutdown(); 296 void Shutdown();
305 297
306 // Look up an extension by ID. Does not include terminated 298 // Look up an extension by ID. Does not include terminated
307 // extensions. 299 // extensions.
308 virtual const extensions::Extension* GetExtensionById( 300 virtual const extensions::Extension* GetExtensionById(
309 const std::string& id, bool include_disabled) const OVERRIDE; 301 const std::string& id, bool include_disabled) const OVERRIDE;
310 302
311 enum IncludeFlag { 303 enum IncludeFlag {
312 INCLUDE_NONE = 0, 304 INCLUDE_NONE = 0,
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
575 extensions::WindowEventRouter* window_event_router() { 567 extensions::WindowEventRouter* window_event_router() {
576 return window_event_router_.get(); 568 return window_event_router_.get();
577 } 569 }
578 570
579 #if defined(OS_CHROMEOS) 571 #if defined(OS_CHROMEOS)
580 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() { 572 chromeos::ExtensionInputMethodEventRouter* input_method_event_router() {
581 return input_method_event_router_.get(); 573 return input_method_event_router_.get();
582 } 574 }
583 #endif 575 #endif
584 576
585 extensions::PushMessagingEventRouter* push_messaging_event_router() {
586 return push_messaging_event_router_.get();
587 }
588
589 // Notify the frontend that there was an error loading an extension. 577 // Notify the frontend that there was an error loading an extension.
590 // This method is public because UnpackedInstaller and InstalledLoader 578 // This method is public because UnpackedInstaller and InstalledLoader
591 // can post to here. 579 // can post to here.
592 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency 580 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency
593 // of these classes on ExtensionService. 581 // of these classes on ExtensionService.
594 void ReportExtensionLoadError(const FilePath& extension_path, 582 void ReportExtensionLoadError(const FilePath& extension_path,
595 const std::string& error, 583 const std::string& error,
596 bool be_noisy); 584 bool be_noisy);
597 585
598 // ExtensionHost of background page calls this method right after its render 586 // ExtensionHost of background page calls this method right after its render
(...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after
987 975
988 scoped_ptr<extensions::WindowEventRouter> window_event_router_; 976 scoped_ptr<extensions::WindowEventRouter> window_event_router_;
989 977
990 scoped_ptr<extensions::PreferenceEventRouter> preference_event_router_; 978 scoped_ptr<extensions::PreferenceEventRouter> preference_event_router_;
991 979
992 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_; 980 scoped_ptr<BookmarkExtensionEventRouter> bookmark_event_router_;
993 981
994 scoped_ptr<extensions::MediaGalleriesPrivateEventRouter> 982 scoped_ptr<extensions::MediaGalleriesPrivateEventRouter>
995 media_galleries_private_event_router_; 983 media_galleries_private_event_router_;
996 984
997 scoped_ptr<extensions::PushMessagingEventRouter>
998 push_messaging_event_router_;
999
1000 #if defined(OS_CHROMEOS) 985 #if defined(OS_CHROMEOS)
1001 scoped_ptr<chromeos::ExtensionInputMethodEventRouter> 986 scoped_ptr<chromeos::ExtensionInputMethodEventRouter>
1002 input_method_event_router_; 987 input_method_event_router_;
1003 #endif 988 #endif
1004 989
1005 // A collection of external extension providers. Each provider reads 990 // A collection of external extension providers. Each provider reads
1006 // a source of external extension information. Examples include the 991 // a source of external extension information. Examples include the
1007 // windows registry and external_extensions.json. 992 // windows registry and external_extensions.json.
1008 extensions::ProviderCollection external_extension_providers_; 993 extensions::ProviderCollection external_extension_providers_;
1009 994
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
1047 #endif 1032 #endif
1048 1033
1049 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1034 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1050 InstallAppsWithUnlimtedStorage); 1035 InstallAppsWithUnlimtedStorage);
1051 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 1036 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
1052 InstallAppsAndCheckStorageProtection); 1037 InstallAppsAndCheckStorageProtection);
1053 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 1038 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
1054 }; 1039 };
1055 1040
1056 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 1041 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698