OLD | NEW |
---|---|
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 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
79 | 79 |
80 namespace extensions { | 80 namespace extensions { |
81 class AppSyncData; | 81 class AppSyncData; |
82 class ComponentLoader; | 82 class ComponentLoader; |
83 class ContentSettingsStore; | 83 class ContentSettingsStore; |
84 class Extension; | 84 class Extension; |
85 class ExtensionCookiesEventRouter; | 85 class ExtensionCookiesEventRouter; |
86 class ExtensionSyncData; | 86 class ExtensionSyncData; |
87 class ExtensionSystem; | 87 class ExtensionSystem; |
88 class ExtensionUpdater; | 88 class ExtensionUpdater; |
89 class RequirementsProvider; | |
89 class SettingsFrontend; | 90 class SettingsFrontend; |
90 class WebNavigationEventRouter; | 91 class WebNavigationEventRouter; |
91 } | 92 } |
92 | 93 |
93 // This is an interface class to encapsulate the dependencies that | 94 // This is an interface class to encapsulate the dependencies that |
94 // various classes have on ExtensionService. This allows easy mocking. | 95 // various classes have on ExtensionService. This allows easy mocking. |
95 class ExtensionServiceInterface : public syncer::SyncableService { | 96 class ExtensionServiceInterface : public syncer::SyncableService { |
96 public: | 97 public: |
97 // A function that returns true if the given extension should be | 98 // A function that returns true if the given extension should be |
98 // included and false if it should be filtered out. Identical to | 99 // included and false if it should be filtered out. Identical to |
(...skipping 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
343 | 344 |
344 // Enables the extension. If the extension is already enabled, does | 345 // Enables the extension. If the extension is already enabled, does |
345 // nothing. | 346 // nothing. |
346 virtual void EnableExtension(const std::string& extension_id); | 347 virtual void EnableExtension(const std::string& extension_id); |
347 | 348 |
348 // Disables the extension. If the extension is already disabled, or | 349 // Disables the extension. If the extension is already disabled, or |
349 // cannot be disabled, does nothing. | 350 // cannot be disabled, does nothing. |
350 virtual void DisableExtension(const std::string& extension_id, | 351 virtual void DisableExtension(const std::string& extension_id, |
351 extensions::Extension::DisableReason disable_reason); | 352 extensions::Extension::DisableReason disable_reason); |
352 | 353 |
354 // Called to report an extension that declares requirements that are not meet | |
Aaron Boodman
2012/07/22 17:46:25
s/meet/met/
| |
355 // by the system. An install warning will be added to the extension, and if | |
356 // |disable_extension| is true, the extension will be disabled. | |
357 void UnsupportedRequirements(const std::string& extension_id, | |
358 const string16& error, | |
359 bool disable_extension); | |
360 | |
353 // Updates the |extension|'s granted permissions lists to include all | 361 // Updates the |extension|'s granted permissions lists to include all |
354 // permissions in the |extension|'s manifest and re-enables the | 362 // permissions in the |extension|'s manifest and re-enables the |
355 // extension. | 363 // extension. |
356 void GrantPermissionsAndEnableExtension( | 364 void GrantPermissionsAndEnableExtension( |
357 const extensions::Extension* extension, | 365 const extensions::Extension* extension, |
358 bool record_oauth2_grant); | 366 bool record_oauth2_grant); |
359 | 367 |
360 // Check for updates (or potentially new extensions from external providers) | 368 // Check for updates (or potentially new extensions from external providers) |
361 void CheckForExternalUpdates(); | 369 void CheckForExternalUpdates(); |
362 | 370 |
(...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
847 ExtensionWarningSet extension_warnings_; | 855 ExtensionWarningSet extension_warnings_; |
848 | 856 |
849 scoped_ptr<extensions::APIResourceController> api_resource_controller_; | 857 scoped_ptr<extensions::APIResourceController> api_resource_controller_; |
850 | 858 |
851 extensions::ProcessMap process_map_; | 859 extensions::ProcessMap process_map_; |
852 | 860 |
853 AppShortcutManager app_shortcut_manager_; | 861 AppShortcutManager app_shortcut_manager_; |
854 | 862 |
855 scoped_ptr<ExtensionErrorUI> extension_error_ui_; | 863 scoped_ptr<ExtensionErrorUI> extension_error_ui_; |
856 | 864 |
865 // The provider that checks if an extension is supported. | |
866 scoped_ptr<extensions::RequirementsProvider> requirements_provider_; | |
867 | |
857 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 868 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
858 InstallAppsWithUnlimtedStorage); | 869 InstallAppsWithUnlimtedStorage); |
859 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 870 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
860 InstallAppsAndCheckStorageProtection); | 871 InstallAppsAndCheckStorageProtection); |
861 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 872 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
862 }; | 873 }; |
863 | 874 |
864 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 875 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |