| 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/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/file_path.h" | 16 #include "base/file_path.h" |
| 17 #include "base/gtest_prod_util.h" | 17 #include "base/gtest_prod_util.h" |
| 18 #include "base/memory/linked_ptr.h" | 18 #include "base/memory/linked_ptr.h" |
| 19 #include "base/memory/ref_counted.h" | 19 #include "base/memory/ref_counted.h" |
| 20 #include "base/memory/weak_ptr.h" | 20 #include "base/memory/weak_ptr.h" |
| 21 #include "base/property_bag.h" | 21 #include "base/property_bag.h" |
| 22 #include "base/string16.h" | 22 #include "base/string16.h" |
| 23 #include "base/time.h" | 23 #include "base/time.h" |
| 24 #include "base/tuple.h" | 24 #include "base/tuple.h" |
| 25 #include "chrome/browser/extensions/api/api_resource_controller.h" | |
| 26 #include "chrome/browser/extensions/app_shortcut_manager.h" | 25 #include "chrome/browser/extensions/app_shortcut_manager.h" |
| 27 #include "chrome/browser/extensions/app_sync_bundle.h" | 26 #include "chrome/browser/extensions/app_sync_bundle.h" |
| 28 #include "chrome/browser/extensions/apps_promo.h" | 27 #include "chrome/browser/extensions/apps_promo.h" |
| 29 #include "chrome/browser/extensions/extension_icon_manager.h" | 28 #include "chrome/browser/extensions/extension_icon_manager.h" |
| 30 #include "chrome/browser/extensions/extension_prefs.h" | 29 #include "chrome/browser/extensions/extension_prefs.h" |
| 31 #include "chrome/browser/extensions/extension_process_manager.h" | 30 #include "chrome/browser/extensions/extension_process_manager.h" |
| 32 #include "chrome/browser/extensions/extension_sync_bundle.h" | 31 #include "chrome/browser/extensions/extension_sync_bundle.h" |
| 33 #include "chrome/browser/extensions/extension_toolbar_model.h" | 32 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 34 #include "chrome/browser/extensions/extension_warning_set.h" | 33 #include "chrome/browser/extensions/extension_warning_set.h" |
| 35 #include "chrome/browser/extensions/extensions_quota_service.h" | 34 #include "chrome/browser/extensions/extensions_quota_service.h" |
| (...skipping 569 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 605 #if defined(UNIT_TEST) | 604 #if defined(UNIT_TEST) |
| 606 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) { | 605 void TrackTerminatedExtensionForTest(const extensions::Extension* extension) { |
| 607 TrackTerminatedExtension(extension); | 606 TrackTerminatedExtension(extension); |
| 608 } | 607 } |
| 609 #endif | 608 #endif |
| 610 | 609 |
| 611 ExtensionWarningSet* extension_warnings() { | 610 ExtensionWarningSet* extension_warnings() { |
| 612 return &extension_warnings_; | 611 return &extension_warnings_; |
| 613 } | 612 } |
| 614 | 613 |
| 615 // Call only from IO thread. | |
| 616 extensions::APIResourceController* api_resource_controller(); | |
| 617 | |
| 618 AppShortcutManager* app_shortcut_manager() { return &app_shortcut_manager_; } | 614 AppShortcutManager* app_shortcut_manager() { return &app_shortcut_manager_; } |
| 619 | 615 |
| 620 // Specialization of syncer::SyncableService::AsWeakPtr. | 616 // Specialization of syncer::SyncableService::AsWeakPtr. |
| 621 base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); } | 617 base::WeakPtr<ExtensionService> AsWeakPtr() { return base::AsWeakPtr(this); } |
| 622 | 618 |
| 623 private: | 619 private: |
| 624 // Contains Extension data that can change during the life of the process, | 620 // Contains Extension data that can change during the life of the process, |
| 625 // but does not persist across restarts. | 621 // but does not persist across restarts. |
| 626 struct ExtensionRuntimeData { | 622 struct ExtensionRuntimeData { |
| 627 // True if the background page is ready. | 623 // True if the background page is ready. |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 835 bool update_once_all_providers_are_ready_; | 831 bool update_once_all_providers_are_ready_; |
| 836 | 832 |
| 837 NaClModuleInfoList nacl_module_list_; | 833 NaClModuleInfoList nacl_module_list_; |
| 838 | 834 |
| 839 extensions::AppSyncBundle app_sync_bundle_; | 835 extensions::AppSyncBundle app_sync_bundle_; |
| 840 extensions::ExtensionSyncBundle extension_sync_bundle_; | 836 extensions::ExtensionSyncBundle extension_sync_bundle_; |
| 841 | 837 |
| 842 // Contains an entry for each warning that shall be currently shown. | 838 // Contains an entry for each warning that shall be currently shown. |
| 843 ExtensionWarningSet extension_warnings_; | 839 ExtensionWarningSet extension_warnings_; |
| 844 | 840 |
| 845 scoped_ptr<extensions::APIResourceController> api_resource_controller_; | |
| 846 | |
| 847 extensions::ProcessMap process_map_; | 841 extensions::ProcessMap process_map_; |
| 848 | 842 |
| 849 AppShortcutManager app_shortcut_manager_; | 843 AppShortcutManager app_shortcut_manager_; |
| 850 | 844 |
| 851 scoped_ptr<ExtensionGlobalError> extension_global_error_; | 845 scoped_ptr<ExtensionGlobalError> extension_global_error_; |
| 852 | 846 |
| 853 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 847 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 854 InstallAppsWithUnlimtedStorage); | 848 InstallAppsWithUnlimtedStorage); |
| 855 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 849 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 856 InstallAppsAndCheckStorageProtection); | 850 InstallAppsAndCheckStorageProtection); |
| 857 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 851 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 858 }; | 852 }; |
| 859 | 853 |
| 860 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 854 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |