| 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> | 
| 11 #include <string> | 11 #include <string> | 
| 12 #include <vector> | 12 #include <vector> | 
| 13 | 13 | 
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" | 
| 15 #include "base/file_path.h" | 15 #include "base/file_path.h" | 
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" | 
| 17 #include "base/memory/linked_ptr.h" | 17 #include "base/memory/linked_ptr.h" | 
| 18 #include "base/memory/ref_counted.h" | 18 #include "base/memory/ref_counted.h" | 
| 19 #include "base/task.h" | 19 #include "base/task.h" | 
| 20 #include "base/time.h" | 20 #include "base/time.h" | 
| 21 #include "base/tuple.h" | 21 #include "base/tuple.h" | 
| 22 #include "chrome/browser/extensions/default_apps.h" | 22 #include "chrome/browser/extensions/apps_promo.h" | 
| 23 #include "chrome/browser/extensions/extension_icon_manager.h" | 23 #include "chrome/browser/extensions/extension_icon_manager.h" | 
| 24 #include "chrome/browser/extensions/extension_menu_manager.h" | 24 #include "chrome/browser/extensions/extension_menu_manager.h" | 
| 25 #include "chrome/browser/extensions/extension_prefs.h" | 25 #include "chrome/browser/extensions/extension_prefs.h" | 
| 26 #include "chrome/browser/extensions/extension_process_manager.h" | 26 #include "chrome/browser/extensions/extension_process_manager.h" | 
| 27 #include "chrome/browser/extensions/extension_toolbar_model.h" | 27 #include "chrome/browser/extensions/extension_toolbar_model.h" | 
| 28 #include "chrome/browser/extensions/extensions_quota_service.h" | 28 #include "chrome/browser/extensions/extensions_quota_service.h" | 
| 29 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 29 #include "chrome/browser/extensions/external_extension_provider_interface.h" | 
| 30 #include "chrome/browser/extensions/pending_extension_manager.h" | 30 #include "chrome/browser/extensions/pending_extension_manager.h" | 
| 31 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 31 #include "chrome/browser/extensions/sandboxed_extension_unpacker.h" | 
| 32 #include "chrome/browser/prefs/pref_change_registrar.h" | 32 #include "chrome/browser/prefs/pref_change_registrar.h" | 
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 156   // Registers an extension to be loaded as a component extension. | 156   // Registers an extension to be loaded as a component extension. | 
| 157   void register_component_extension(const ComponentExtensionInfo& info) { | 157   void register_component_extension(const ComponentExtensionInfo& info) { | 
| 158     component_extension_manifests_.push_back(info); | 158     component_extension_manifests_.push_back(info); | 
| 159   } | 159   } | 
| 160 | 160 | 
| 161   // Returns true if any extensions are installed. | 161   // Returns true if any extensions are installed. | 
| 162   virtual bool HasInstalledExtensions(); | 162   virtual bool HasInstalledExtensions(); | 
| 163 | 163 | 
| 164   const FilePath& install_directory() const { return install_directory_; } | 164   const FilePath& install_directory() const { return install_directory_; } | 
| 165 | 165 | 
| 166   DefaultApps* default_apps() { return &default_apps_; } | 166   AppsPromo* apps_promo() { return &apps_promo_; } | 
| 167 | 167 | 
| 168   // Whether this extension can run in an incognito window. | 168   // Whether this extension can run in an incognito window. | 
| 169   virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 169   virtual bool IsIncognitoEnabled(const std::string& extension_id) const; | 
| 170   virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 170   virtual void SetIsIncognitoEnabled(const std::string& extension_id, | 
| 171                                      bool enabled); | 171                                      bool enabled); | 
| 172 | 172 | 
| 173   // Returns true if the given extension can see events and data from another | 173   // Returns true if the given extension can see events and data from another | 
| 174   // sub-profile (incognito to original profile, or vice versa). | 174   // sub-profile (incognito to original profile, or vice versa). | 
| 175   bool CanCrossIncognito(const Extension* extension); | 175   bool CanCrossIncognito(const Extension* extension); | 
| 176 | 176 | 
| (...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 548   ExtensionMenuManager menu_manager_; | 548   ExtensionMenuManager menu_manager_; | 
| 549 | 549 | 
| 550   // Keeps track of favicon-sized omnibox icons for extensions. | 550   // Keeps track of favicon-sized omnibox icons for extensions. | 
| 551   ExtensionIconManager omnibox_icon_manager_; | 551   ExtensionIconManager omnibox_icon_manager_; | 
| 552   ExtensionIconManager omnibox_popup_icon_manager_; | 552   ExtensionIconManager omnibox_popup_icon_manager_; | 
| 553 | 553 | 
| 554   // List of registered component extensions (see Extension::Location). | 554   // List of registered component extensions (see Extension::Location). | 
| 555   typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 555   typedef std::vector<ComponentExtensionInfo> RegisteredComponentExtensions; | 
| 556   RegisteredComponentExtensions component_extension_manifests_; | 556   RegisteredComponentExtensions component_extension_manifests_; | 
| 557 | 557 | 
| 558   // Manages the installation of default apps and the promotion of them in the | 558   // Manages the promotion of the web store. | 
| 559   // app launcher. | 559   AppsPromo apps_promo_; | 
| 560   DefaultApps default_apps_; |  | 
| 561 | 560 | 
| 562   // Flag to make sure event routers are only initialized once. | 561   // Flag to make sure event routers are only initialized once. | 
| 563   bool event_routers_initialized_; | 562   bool event_routers_initialized_; | 
| 564 | 563 | 
| 565   scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; | 564   scoped_ptr<ExtensionBrowserEventRouter> browser_event_router_; | 
| 566 | 565 | 
| 567   scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; | 566   scoped_ptr<ExtensionPreferenceEventRouter> preference_event_router_; | 
| 568 | 567 | 
| 569   // A collection of external extension providers.  Each provider reads | 568   // A collection of external extension providers.  Each provider reads | 
| 570   // a source of external extension information.  Examples include the | 569   // a source of external extension information.  Examples include the | 
| 571   // windows registry and external_extensions.json. | 570   // windows registry and external_extensions.json. | 
| 572   ProviderCollection external_extension_providers_; | 571   ProviderCollection external_extension_providers_; | 
| 573 | 572 | 
| 574   // Set to true by OnExternalExtensionUpdateUrlFound() when an external | 573   // Set to true by OnExternalExtensionUpdateUrlFound() when an external | 
| 575   // extension URL is found.  Used in CheckForExternalUpdates() to see | 574   // extension URL is found.  Used in CheckForExternalUpdates() to see | 
| 576   // if an update check is needed to install pending extensions. | 575   // if an update check is needed to install pending extensions. | 
| 577   bool external_extension_url_added_; | 576   bool external_extension_url_added_; | 
| 578 | 577 | 
| 579   FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 578   FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 
| 580                            InstallAppsWithUnlimtedStorage); | 579                            InstallAppsWithUnlimtedStorage); | 
| 581   FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 580   FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 
| 582                            InstallAppsAndCheckStorageProtection); | 581                            InstallAppsAndCheckStorageProtection); | 
| 583   DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 582   DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 
| 584 }; | 583 }; | 
| 585 | 584 | 
| 586 #endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 585 #endif  // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 
| OLD | NEW | 
|---|