| 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_process_manager.h" | 25 #include "chrome/browser/extensions/extension_process_manager.h" |
| 26 #include "chrome/browser/extensions/extension_sync_service.h" | 26 #include "chrome/browser/extensions/extension_sync_service.h" |
| 27 #include "chrome/browser/extensions/extension_toolbar_model.h" | |
| 28 #include "chrome/browser/extensions/extensions_quota_service.h" | 27 #include "chrome/browser/extensions/extensions_quota_service.h" |
| 29 #include "chrome/browser/extensions/external_provider_interface.h" | 28 #include "chrome/browser/extensions/external_provider_interface.h" |
| 30 #include "chrome/browser/extensions/management_policy.h" | 29 #include "chrome/browser/extensions/management_policy.h" |
| 31 #include "chrome/browser/extensions/menu_manager.h" | 30 #include "chrome/browser/extensions/menu_manager.h" |
| 32 #include "chrome/browser/extensions/pending_enables.h" | 31 #include "chrome/browser/extensions/pending_enables.h" |
| 33 #include "chrome/browser/extensions/pending_extension_manager.h" | 32 #include "chrome/browser/extensions/pending_extension_manager.h" |
| 34 #include "chrome/browser/extensions/process_map.h" | 33 #include "chrome/browser/extensions/process_map.h" |
| 35 #include "chrome/browser/extensions/update_observer.h" | 34 #include "chrome/browser/extensions/update_observer.h" |
| 36 #include "chrome/common/extensions/extension.h" | 35 #include "chrome/common/extensions/extension.h" |
| 37 #include "chrome/common/extensions/extension_constants.h" | 36 #include "chrome/common/extensions/extension_constants.h" |
| (...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 | 447 |
| 449 virtual base::SequencedTaskRunner* GetFileTaskRunner() OVERRIDE; | 448 virtual base::SequencedTaskRunner* GetFileTaskRunner() OVERRIDE; |
| 450 | 449 |
| 451 extensions::ComponentLoader* component_loader() { | 450 extensions::ComponentLoader* component_loader() { |
| 452 return component_loader_.get(); | 451 return component_loader_.get(); |
| 453 } | 452 } |
| 454 | 453 |
| 455 // Note that this may return NULL if autoupdate is not turned on. | 454 // Note that this may return NULL if autoupdate is not turned on. |
| 456 extensions::ExtensionUpdater* updater(); | 455 extensions::ExtensionUpdater* updater(); |
| 457 | 456 |
| 458 ExtensionToolbarModel* toolbar_model() { return &toolbar_model_; } | |
| 459 | |
| 460 ExtensionsQuotaService* quota_service() { return "a_service_; } | 457 ExtensionsQuotaService* quota_service() { return "a_service_; } |
| 461 | 458 |
| 462 extensions::MenuManager* menu_manager() { return &menu_manager_; } | 459 extensions::MenuManager* menu_manager() { return &menu_manager_; } |
| 463 | 460 |
| 464 // Notify the frontend that there was an error loading an extension. | 461 // Notify the frontend that there was an error loading an extension. |
| 465 // This method is public because UnpackedInstaller and InstalledLoader | 462 // This method is public because UnpackedInstaller and InstalledLoader |
| 466 // can post to here. | 463 // can post to here. |
| 467 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency | 464 // TODO(aa): Remove this. It doesn't do enough to be worth the dependency |
| 468 // of these classes on ExtensionService. | 465 // of these classes on ExtensionService. |
| 469 void ReportExtensionLoadError(const base::FilePath& extension_path, | 466 void ReportExtensionLoadError(const base::FilePath& extension_path, |
| (...skipping 295 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 765 | 762 |
| 766 // Used by dispatchers to limit API quota for individual extensions. | 763 // Used by dispatchers to limit API quota for individual extensions. |
| 767 ExtensionsQuotaService quota_service_; | 764 ExtensionsQuotaService quota_service_; |
| 768 | 765 |
| 769 // Signaled when all extensions are loaded. | 766 // Signaled when all extensions are loaded. |
| 770 extensions::OneShotEvent* const ready_; | 767 extensions::OneShotEvent* const ready_; |
| 771 | 768 |
| 772 // Our extension updater, if updates are turned on. | 769 // Our extension updater, if updates are turned on. |
| 773 scoped_ptr<extensions::ExtensionUpdater> updater_; | 770 scoped_ptr<extensions::ExtensionUpdater> updater_; |
| 774 | 771 |
| 775 // The model that tracks extensions with BrowserAction buttons. | |
| 776 ExtensionToolbarModel toolbar_model_; | |
| 777 | |
| 778 // Map unloaded extensions' ids to their paths. When a temporarily loaded | 772 // Map unloaded extensions' ids to their paths. When a temporarily loaded |
| 779 // extension is unloaded, we lose the information about it and don't have | 773 // extension is unloaded, we lose the information about it and don't have |
| 780 // any in the extension preferences file. | 774 // any in the extension preferences file. |
| 781 typedef std::map<std::string, base::FilePath> UnloadedExtensionPathMap; | 775 typedef std::map<std::string, base::FilePath> UnloadedExtensionPathMap; |
| 782 UnloadedExtensionPathMap unloaded_extension_paths_; | 776 UnloadedExtensionPathMap unloaded_extension_paths_; |
| 783 | 777 |
| 784 // Store the ids of reloading extensions. | 778 // Store the ids of reloading extensions. |
| 785 std::set<std::string> reloading_extensions_; | 779 std::set<std::string> reloading_extensions_; |
| 786 | 780 |
| 787 // Map of DevToolsAgentHost instances that are detached, | 781 // Map of DevToolsAgentHost instances that are detached, |
| (...skipping 67 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 |