| 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> |
| 11 #include <string> | 11 #include <string> |
| 12 #include <vector> | 12 #include <vector> |
| 13 | 13 |
| 14 #include "base/compiler_specific.h" | 14 #include "base/compiler_specific.h" |
| 15 #include "base/files/file_path.h" | 15 #include "base/files/file_path.h" |
| 16 #include "base/gtest_prod_util.h" | 16 #include "base/gtest_prod_util.h" |
| 17 #include "base/memory/ref_counted.h" | 17 #include "base/memory/ref_counted.h" |
| 18 #include "base/memory/weak_ptr.h" | 18 #include "base/memory/weak_ptr.h" |
| 19 #include "base/prefs/pref_change_registrar.h" | 19 #include "base/prefs/pref_change_registrar.h" |
| 20 #include "base/strings/string16.h" | 20 #include "base/strings/string16.h" |
| 21 #include "chrome/browser/extensions/blacklist.h" | 21 #include "chrome/browser/extensions/blacklist.h" |
| 22 #include "chrome/browser/extensions/extension_function_histogram_value.h" | 22 #include "chrome/browser/extensions/extension_function_histogram_value.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_prefs.h" | 24 #include "chrome/browser/extensions/extension_prefs.h" |
| 25 #include "chrome/browser/extensions/extension_sync_service.h" | 25 #include "chrome/browser/extensions/extension_sync_service.h" |
| 26 #include "chrome/browser/extensions/external_provider_interface.h" | 26 #include "chrome/browser/extensions/external_provider_interface.h" |
| 27 #include "chrome/browser/extensions/management_policy.h" | 27 #include "chrome/browser/extensions/management_policy.h" |
| 28 #include "chrome/browser/extensions/menu_manager.h" | |
| 29 #include "chrome/browser/extensions/pending_enables.h" | 28 #include "chrome/browser/extensions/pending_enables.h" |
| 30 #include "chrome/browser/extensions/pending_extension_manager.h" | 29 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 31 #include "chrome/browser/extensions/process_map.h" | 30 #include "chrome/browser/extensions/process_map.h" |
| 32 #include "chrome/browser/extensions/update_observer.h" | 31 #include "chrome/browser/extensions/update_observer.h" |
| 33 #include "chrome/common/extensions/extension.h" | 32 #include "chrome/common/extensions/extension.h" |
| 34 #include "chrome/common/extensions/extension_constants.h" | 33 #include "chrome/common/extensions/extension_constants.h" |
| 35 #include "chrome/common/extensions/extension_set.h" | 34 #include "chrome/common/extensions/extension_set.h" |
| 36 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" | 35 #include "chrome/common/extensions/manifest_handlers/shared_module_info.h" |
| 37 #include "content/public/browser/devtools_agent_host.h" | 36 #include "content/public/browser/devtools_agent_host.h" |
| 38 #include "content/public/browser/notification_observer.h" | 37 #include "content/public/browser/notification_observer.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 449 | 448 |
| 450 extensions::ComponentLoader* component_loader() { | 449 extensions::ComponentLoader* component_loader() { |
| 451 return component_loader_.get(); | 450 return component_loader_.get(); |
| 452 } | 451 } |
| 453 | 452 |
| 454 // Note that this may return NULL if autoupdate is not turned on. | 453 // Note that this may return NULL if autoupdate is not turned on. |
| 455 extensions::ExtensionUpdater* updater(); | 454 extensions::ExtensionUpdater* updater(); |
| 456 | 455 |
| 457 extensions::QuotaService* quota_service() { return "a_service_; } | 456 extensions::QuotaService* quota_service() { return "a_service_; } |
| 458 | 457 |
| 459 extensions::MenuManager* menu_manager() { return &menu_manager_; } | |
| 460 | |
| 461 // Sets the name, id and icon resource path of the given extension into the | 458 // Sets the name, id and icon resource path of the given extension into the |
| 462 // returned dictionary. Returns an empty dictionary if the given extension id | 459 // returned dictionary. Returns an empty dictionary if the given extension id |
| 463 // is not found. | 460 // is not found. |
| 464 scoped_ptr<DictionaryValue> GetExtensionInfo( | 461 scoped_ptr<DictionaryValue> GetExtensionInfo( |
| 465 const std::string& extension_id) const; | 462 const std::string& extension_id) const; |
| 466 | 463 |
| 467 // Notify the frontend that there was an error loading an extension. | 464 // Notify the frontend that there was an error loading an extension. |
| 468 // This method is public because UnpackedInstaller and InstalledLoader | 465 // This method is public because UnpackedInstaller and InstalledLoader |
| 469 // can post to here. | 466 // can post to here. |
| 470 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency | 467 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency |
| (...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 789 typedef std::map<std::string, scoped_refptr<content::DevToolsAgentHost> > | 786 typedef std::map<std::string, scoped_refptr<content::DevToolsAgentHost> > |
| 790 OrphanedDevTools; | 787 OrphanedDevTools; |
| 791 OrphanedDevTools orphaned_dev_tools_; | 788 OrphanedDevTools orphaned_dev_tools_; |
| 792 | 789 |
| 793 content::NotificationRegistrar registrar_; | 790 content::NotificationRegistrar registrar_; |
| 794 PrefChangeRegistrar pref_change_registrar_; | 791 PrefChangeRegistrar pref_change_registrar_; |
| 795 | 792 |
| 796 // Keeps track of loading and unloading component extensions. | 793 // Keeps track of loading and unloading component extensions. |
| 797 scoped_ptr<extensions::ComponentLoader> component_loader_; | 794 scoped_ptr<extensions::ComponentLoader> component_loader_; |
| 798 | 795 |
| 799 // Keeps track of menu items added by extensions. | |
| 800 extensions::MenuManager menu_manager_; | |
| 801 | |
| 802 // A collection of external extension providers. Each provider reads | 796 // A collection of external extension providers. Each provider reads |
| 803 // a source of external extension information. Examples include the | 797 // a source of external extension information. Examples include the |
| 804 // windows registry and external_extensions.json. | 798 // windows registry and external_extensions.json. |
| 805 extensions::ProviderCollection external_extension_providers_; | 799 extensions::ProviderCollection external_extension_providers_; |
| 806 | 800 |
| 807 // Set to true by OnExternalExtensionUpdateUrlFound() when an external | 801 // Set to true by OnExternalExtensionUpdateUrlFound() when an external |
| 808 // extension URL is found, and by CheckForUpdatesSoon() when an update check | 802 // extension URL is found, and by CheckForUpdatesSoon() when an update check |
| 809 // has to wait for the external providers. Used in | 803 // has to wait for the external providers. Used in |
| 810 // OnAllExternalProvidersReady() to determine if an update check is needed to | 804 // OnAllExternalProvidersReady() to determine if an update check is needed to |
| 811 // install pending extensions. | 805 // install pending extensions. |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 855 #endif | 849 #endif |
| 856 | 850 |
| 857 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 851 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 858 InstallAppsWithUnlimtedStorage); | 852 InstallAppsWithUnlimtedStorage); |
| 859 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 853 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 860 InstallAppsAndCheckStorageProtection); | 854 InstallAppsAndCheckStorageProtection); |
| 861 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 855 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 862 }; | 856 }; |
| 863 | 857 |
| 864 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 858 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |