| 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 class ExtensionToolbarModel; | 47 class ExtensionToolbarModel; |
| 48 class GURL; | 48 class GURL; |
| 49 class Profile; | 49 class Profile; |
| 50 class Version; | 50 class Version; |
| 51 | 51 |
| 52 namespace base { | 52 namespace base { |
| 53 class SequencedTaskRunner; | 53 class SequencedTaskRunner; |
| 54 } | 54 } |
| 55 | 55 |
| 56 namespace extensions { | 56 namespace extensions { |
| 57 class AppNotificationManager; | |
| 58 class AppSyncData; | 57 class AppSyncData; |
| 59 class BrowserEventRouter; | 58 class BrowserEventRouter; |
| 60 class ComponentLoader; | 59 class ComponentLoader; |
| 61 class ContentSettingsStore; | 60 class ContentSettingsStore; |
| 62 class CrxInstaller; | 61 class CrxInstaller; |
| 63 class ExtensionActionStorageManager; | 62 class ExtensionActionStorageManager; |
| 64 class ExtensionSyncData; | 63 class ExtensionSyncData; |
| 65 class ExtensionSystem; | 64 class ExtensionSystem; |
| 66 class ExtensionUpdater; | 65 class ExtensionUpdater; |
| 67 class PendingExtensionManager; | 66 class PendingExtensionManager; |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 221 |
| 223 const base::FilePath& install_directory() const { return install_directory_; } | 222 const base::FilePath& install_directory() const { return install_directory_; } |
| 224 | 223 |
| 225 extensions::ProcessMap* process_map() { return &process_map_; } | 224 extensions::ProcessMap* process_map() { return &process_map_; } |
| 226 | 225 |
| 227 // Whether this extension can run in an incognito window. | 226 // Whether this extension can run in an incognito window. |
| 228 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 227 virtual bool IsIncognitoEnabled(const std::string& extension_id) const; |
| 229 virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 228 virtual void SetIsIncognitoEnabled(const std::string& extension_id, |
| 230 bool enabled); | 229 bool enabled); |
| 231 | 230 |
| 232 // When app notification setup is done, we call this to save the developer's | |
| 233 // oauth client id which we'll need at uninstall time to revoke the oauth | |
| 234 // permission grant for sending notifications. | |
| 235 virtual void SetAppNotificationSetupDone(const std::string& extension_id, | |
| 236 const std::string& oauth_client_id); | |
| 237 | |
| 238 virtual void SetAppNotificationDisabled(const std::string& extension_id, | |
| 239 bool value); | |
| 240 | |
| 241 // Updates the app launcher value for the moved extension so that it is now | 231 // Updates the app launcher value for the moved extension so that it is now |
| 242 // located after the given predecessor and before the successor. This will | 232 // located after the given predecessor and before the successor. This will |
| 243 // trigger a sync if needed. Empty strings are used to indicate no successor | 233 // trigger a sync if needed. Empty strings are used to indicate no successor |
| 244 // or predecessor. | 234 // or predecessor. |
| 245 void OnExtensionMoved(const std::string& moved_extension_id, | 235 void OnExtensionMoved(const std::string& moved_extension_id, |
| 246 const std::string& predecessor_extension_id, | 236 const std::string& predecessor_extension_id, |
| 247 const std::string& successor_extension_id); | 237 const std::string& successor_extension_id); |
| 248 | 238 |
| 249 // Returns true if the given extension can see events and data from another | 239 // Returns true if the given extension can see events and data from another |
| 250 // sub-profile (incognito to original profile, or vice versa). | 240 // sub-profile (incognito to original profile, or vice versa). |
| (...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 550 | 540 |
| 551 // Note that this may return NULL if autoupdate is not turned on. | 541 // Note that this may return NULL if autoupdate is not turned on. |
| 552 extensions::ExtensionUpdater* updater(); | 542 extensions::ExtensionUpdater* updater(); |
| 553 | 543 |
| 554 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | 544 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } |
| 555 | 545 |
| 556 ExtensionsQuotaService* quota_service() { return "a_service_; } | 546 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 557 | 547 |
| 558 extensions::MenuManager* menu_manager() { return &menu_manager_; } | 548 extensions::MenuManager* menu_manager() { return &menu_manager_; } |
| 559 | 549 |
| 560 extensions::AppNotificationManager* app_notification_manager() { | |
| 561 return app_notification_manager_.get(); | |
| 562 } | |
| 563 | |
| 564 extensions::BrowserEventRouter* browser_event_router() { | 550 extensions::BrowserEventRouter* browser_event_router() { |
| 565 return browser_event_router_.get(); | 551 return browser_event_router_.get(); |
| 566 } | 552 } |
| 567 | 553 |
| 568 // Notify the frontend that there was an error loading an extension. | 554 // Notify the frontend that there was an error loading an extension. |
| 569 // This method is public because UnpackedInstaller and InstalledLoader | 555 // This method is public because UnpackedInstaller and InstalledLoader |
| 570 // can post to here. | 556 // can post to here. |
| 571 // 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 |
| 572 // of these classes on ExtensionService. | 558 // of these classes on ExtensionService. |
| 573 void ReportExtensionLoadError(const base::FilePath& extension_path, | 559 void ReportExtensionLoadError(const base::FilePath& extension_path, |
| (...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 | 923 |
| 938 content::NotificationRegistrar registrar_; | 924 content::NotificationRegistrar registrar_; |
| 939 PrefChangeRegistrar pref_change_registrar_; | 925 PrefChangeRegistrar pref_change_registrar_; |
| 940 | 926 |
| 941 // Keeps track of loading and unloading component extensions. | 927 // Keeps track of loading and unloading component extensions. |
| 942 scoped_ptr<extensions::ComponentLoader> component_loader_; | 928 scoped_ptr<extensions::ComponentLoader> component_loader_; |
| 943 | 929 |
| 944 // Keeps track of menu items added by extensions. | 930 // Keeps track of menu items added by extensions. |
| 945 extensions::MenuManager menu_manager_; | 931 extensions::MenuManager menu_manager_; |
| 946 | 932 |
| 947 // Keeps track of app notifications. | |
| 948 scoped_refptr<extensions::AppNotificationManager> app_notification_manager_; | |
| 949 | |
| 950 // Flag to make sure event routers are only initialized once. | 933 // Flag to make sure event routers are only initialized once. |
| 951 bool event_routers_initialized_; | 934 bool event_routers_initialized_; |
| 952 | 935 |
| 953 // TODO(yoz): None of these should be owned by ExtensionService. | 936 // TODO(yoz): None of these should be owned by ExtensionService. |
| 954 // crbug.com/159265 | 937 // crbug.com/159265 |
| 955 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; | 938 scoped_ptr<extensions::BrowserEventRouter> browser_event_router_; |
| 956 | 939 |
| 957 // A collection of external extension providers. Each provider reads | 940 // A collection of external extension providers. Each provider reads |
| 958 // a source of external extension information. Examples include the | 941 // a source of external extension information. Examples include the |
| 959 // windows registry and external_extensions.json. | 942 // windows registry and external_extensions.json. |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1000 #endif | 983 #endif |
| 1001 | 984 |
| 1002 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 985 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 1003 InstallAppsWithUnlimtedStorage); | 986 InstallAppsWithUnlimtedStorage); |
| 1004 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 987 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 1005 InstallAppsAndCheckStorageProtection); | 988 InstallAppsAndCheckStorageProtection); |
| 1006 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 989 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 1007 }; | 990 }; |
| 1008 | 991 |
| 1009 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 992 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |