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

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

Issue 23724026: BrowserEventRouter -> TabsEventRouter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Yoyo's nits Created 7 years, 3 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
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 <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after
260 260
261 // Getter and setter for the flag that specifies if the extension has used 261 // Getter and setter for the flag that specifies if the extension has used
262 // the webrequest API. 262 // the webrequest API.
263 // TODO(mpcomplete): remove. http://crbug.com/100411 263 // TODO(mpcomplete): remove. http://crbug.com/100411
264 bool HasUsedWebRequest(const extensions::Extension* extension) const; 264 bool HasUsedWebRequest(const extensions::Extension* extension) const;
265 void SetHasUsedWebRequest(const extensions::Extension* extension, bool value); 265 void SetHasUsedWebRequest(const extensions::Extension* extension, bool value);
266 266
267 // Initialize and start all installed extensions. 267 // Initialize and start all installed extensions.
268 void Init(); 268 void Init();
269 269
270 // Start up the extension event routers.
271 void InitEventRouters();
272
273 // Called when the associated Profile is going to be destroyed. 270 // Called when the associated Profile is going to be destroyed.
274 void Shutdown(); 271 void Shutdown();
275 272
276 // Look up an extension by ID. Does not include terminated 273 // Look up an extension by ID. Does not include terminated
277 // extensions. 274 // extensions.
278 virtual const extensions::Extension* GetExtensionById( 275 virtual const extensions::Extension* GetExtensionById(
279 const std::string& id, bool include_disabled) const OVERRIDE; 276 const std::string& id, bool include_disabled) const OVERRIDE;
280 277
281 enum IncludeFlag { 278 enum IncludeFlag {
282 INCLUDE_NONE = 0, 279 INCLUDE_NONE = 0,
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 544
548 // Note that this may return NULL if autoupdate is not turned on. 545 // Note that this may return NULL if autoupdate is not turned on.
549 extensions::ExtensionUpdater* updater(); 546 extensions::ExtensionUpdater* updater();
550 547
551 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } 548 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; }
552 549
553 ExtensionsQuotaService* quota_service() { return &quota_service_; } 550 ExtensionsQuotaService* quota_service() { return &quota_service_; }
554 551
555 extensions::MenuManager* menu_manager() { return &menu_manager_; } 552 extensions::MenuManager* menu_manager() { return &menu_manager_; }
556 553
557 extensions::BrowserEventRouter* browser_event_router() {
558 return browser_event_router_.get();
559 }
560
561 // Notify the frontend that there was an error loading an extension. 554 // Notify the frontend that there was an error loading an extension.
562 // This method is public because UnpackedInstaller and InstalledLoader 555 // This method is public because UnpackedInstaller and InstalledLoader
563 // can post to here. 556 // can post to here.
564 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency 557 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency
565 // of these classes on ExtensionService. 558 // of these classes on ExtensionService.
566 void ReportExtensionLoadError(const base::FilePath& extension_path, 559 void ReportExtensionLoadError(const base::FilePath& extension_path,
567 const std::string& error, 560 const std::string& error,
568 bool be_noisy); 561 bool be_noisy);
569 562
570 // ExtensionHost of background page calls this method right after its render 563 // ExtensionHost of background page calls this method right after its render
(...skipping 334 matching lines...) Expand 10 before | Expand all | Expand 10 after
905 898
906 content::NotificationRegistrar registrar_; 899 content::NotificationRegistrar registrar_;
907 PrefChangeRegistrar pref_change_registrar_; 900 PrefChangeRegistrar pref_change_registrar_;
908 901
909 // Keeps track of loading and unloading component extensions. 902 // Keeps track of loading and unloading component extensions.
910 scoped_ptr<extensions::ComponentLoader> component_loader_; 903 scoped_ptr<extensions::ComponentLoader> component_loader_;
911 904
912 // Keeps track of menu items added by extensions. 905 // Keeps track of menu items added by extensions.
913 extensions::MenuManager menu_manager_; 906 extensions::MenuManager menu_manager_;
914 907
915 // Flag to make sure event routers are only initialized once.
916 bool event_routers_initialized_;
917
918 // TODO(yoz): None of these should be owned by ExtensionService.
919 // crbug.com/159265
920 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_;
921
922 // A collection of external extension providers. Each provider reads 908 // A collection of external extension providers. Each provider reads
923 // a source of external extension information. Examples include the 909 // a source of external extension information. Examples include the
924 // windows registry and external_extensions.json. 910 // windows registry and external_extensions.json.
925 extensions::ProviderCollection external_extension_providers_; 911 extensions::ProviderCollection external_extension_providers_;
926 912
927 // Set to true by OnExternalExtensionUpdateUrlFound() when an external 913 // Set to true by OnExternalExtensionUpdateUrlFound() when an external
928 // extension URL is found, and by CheckForUpdatesSoon() when an update check 914 // extension URL is found, and by CheckForUpdatesSoon() when an update check
929 // has to wait for the external providers. Used in 915 // has to wait for the external providers. Used in
930 // OnAllExternalProvidersReady() to determine if an update check is needed to 916 // OnAllExternalProvidersReady() to determine if an update check is needed to
931 // install pending extensions. 917 // install pending extensions.
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 #endif 969 #endif
984 970
985 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 971 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
986 InstallAppsWithUnlimtedStorage); 972 InstallAppsWithUnlimtedStorage);
987 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, 973 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest,
988 InstallAppsAndCheckStorageProtection); 974 InstallAppsAndCheckStorageProtection);
989 DISALLOW_COPY_AND_ASSIGN(ExtensionService); 975 DISALLOW_COPY_AND_ASSIGN(ExtensionService);
990 }; 976 };
991 977
992 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ 978 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/browser_event_router.cc ('k') | chrome/browser/extensions/extension_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698