OLD | NEW |
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 #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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <set> | 10 #include <set> |
(...skipping 16 matching lines...) Expand all Loading... |
27 #include "chrome/browser/extensions/extension_permissions_api.h" | 27 #include "chrome/browser/extensions/extension_permissions_api.h" |
28 #include "chrome/browser/extensions/extension_process_manager.h" | 28 #include "chrome/browser/extensions/extension_process_manager.h" |
29 #include "chrome/browser/extensions/extension_settings_frontend.h" | 29 #include "chrome/browser/extensions/extension_settings_frontend.h" |
30 #include "chrome/browser/extensions/extension_sync_data.h" | 30 #include "chrome/browser/extensions/extension_sync_data.h" |
31 #include "chrome/browser/extensions/extension_toolbar_model.h" | 31 #include "chrome/browser/extensions/extension_toolbar_model.h" |
32 #include "chrome/browser/extensions/extension_warning_set.h" | 32 #include "chrome/browser/extensions/extension_warning_set.h" |
33 #include "chrome/browser/extensions/extensions_quota_service.h" | 33 #include "chrome/browser/extensions/extensions_quota_service.h" |
34 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 34 #include "chrome/browser/extensions/external_extension_provider_interface.h" |
35 #include "chrome/browser/extensions/pending_extension_manager.h" | 35 #include "chrome/browser/extensions/pending_extension_manager.h" |
36 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 36 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" |
37 #include "chrome/browser/extensions/webstore_installer.h" | |
38 #include "chrome/browser/prefs/pref_change_registrar.h" | 37 #include "chrome/browser/prefs/pref_change_registrar.h" |
39 #include "chrome/browser/sync/api/sync_change.h" | 38 #include "chrome/browser/sync/api/sync_change.h" |
40 #include "chrome/browser/sync/api/syncable_service.h" | 39 #include "chrome/browser/sync/api/syncable_service.h" |
41 #include "chrome/common/extensions/extension.h" | 40 #include "chrome/common/extensions/extension.h" |
42 #include "chrome/common/extensions/extension_constants.h" | 41 #include "chrome/common/extensions/extension_constants.h" |
43 #include "content/browser/browser_thread.h" | 42 #include "content/browser/browser_thread.h" |
44 #include "content/common/property_bag.h" | 43 #include "content/common/property_bag.h" |
45 #include "content/public/browser/notification_observer.h" | 44 #include "content/public/browser/notification_observer.h" |
46 #include "content/public/browser/notification_registrar.h" | 45 #include "content/public/browser/notification_registrar.h" |
47 | 46 |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 void register_component_extension(const ComponentExtensionInfo& info) { | 198 void register_component_extension(const ComponentExtensionInfo& info) { |
200 component_extension_manifests_.push_back(info); | 199 component_extension_manifests_.push_back(info); |
201 } | 200 } |
202 | 201 |
203 // Unregisters a component extension from the list of extensions to be loaded | 202 // Unregisters a component extension from the list of extensions to be loaded |
204 void UnregisterComponentExtension(const ComponentExtensionInfo& info); | 203 void UnregisterComponentExtension(const ComponentExtensionInfo& info); |
205 | 204 |
206 const FilePath& install_directory() const { return install_directory_; } | 205 const FilePath& install_directory() const { return install_directory_; } |
207 | 206 |
208 AppsPromo* apps_promo() { return &apps_promo_; } | 207 AppsPromo* apps_promo() { return &apps_promo_; } |
209 WebstoreInstaller* webstore_installer() { return &webstore_installer_; } | |
210 | 208 |
211 // Whether this extension can run in an incognito window. | 209 // Whether this extension can run in an incognito window. |
212 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 210 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; |
213 virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 211 virtual void SetIsIncognitoEnabled(const std::string& extension_id, |
214 bool enabled); | 212 bool enabled); |
215 | 213 |
216 // Returns true if the given extension can see events and data from another | 214 // Returns true if the given extension can see events and data from another |
217 // sub-profile (incognito to original profile, or vice versa). | 215 // sub-profile (incognito to original profile, or vice versa). |
218 bool CanCrossIncognito(const Extension* extension); | 216 bool CanCrossIncognito(const Extension* extension); |
219 | 217 |
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 ExtensionIconManager omnibox_icon_manager_; | 788 ExtensionIconManager omnibox_icon_manager_; |
791 ExtensionIconManager omnibox_popup_icon_manager_; | 789 ExtensionIconManager omnibox_popup_icon_manager_; |
792 | 790 |
793 // List of registered component extensions (see Extension::Location). | 791 // List of registered component extensions (see Extension::Location). |
794 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 792 typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; |
795 RegisteredComponentExtensions component_extension_manifests_; | 793 RegisteredComponentExtensions component_extension_manifests_; |
796 | 794 |
797 // Manages the promotion of the web store. | 795 // Manages the promotion of the web store. |
798 AppsPromo apps_promo_; | 796 AppsPromo apps_promo_; |
799 | 797 |
800 // Coordinates the extension download and install process from the gallery. | |
801 WebstoreInstaller webstore_installer_; | |
802 | |
803 // Flag to make sure event routers are only initialized once. | 798 // Flag to make sure event routers are only initialized once. |
804 bool event_routers_initialized_; | 799 bool event_routers_initialized_; |
805 | 800 |
806 scoped_ptr<ExtensionDownloadsEventRouter> downloads_event_router_; | 801 scoped_ptr<ExtensionDownloadsEventRouter> downloads_event_router_; |
807 | 802 |
808 scoped_ptr<ExtensionHistoryEventRouter> history_event_router_; | 803 scoped_ptr<ExtensionHistoryEventRouter> history_event_router_; |
809 | 804 |
810 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; | 805 scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; |
811 | 806 |
812 scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; | 807 scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
844 ExtensionWarningSet extension_warnings_; | 839 ExtensionWarningSet extension_warnings_; |
845 | 840 |
846 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 841 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
847 InstallAppsWithUnlimtedStorage); | 842 InstallAppsWithUnlimtedStorage); |
848 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 843 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
849 InstallAppsAndCheckStorageProtection); | 844 InstallAppsAndCheckStorageProtection); |
850 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 845 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
851 }; | 846 }; |
852 | 847 |
853 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 848 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |