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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 class BrowserEventRouter; | 60 class BrowserEventRouter; |
61 class ComponentLoader; | 61 class ComponentLoader; |
62 class ContentSettingsStore; | 62 class ContentSettingsStore; |
63 class CrxInstaller; | 63 class CrxInstaller; |
64 class ExtensionActionStorageManager; | 64 class ExtensionActionStorageManager; |
65 class ExtensionSyncData; | 65 class ExtensionSyncData; |
66 class ExtensionSystem; | 66 class ExtensionSystem; |
67 class ExtensionUpdater; | 67 class ExtensionUpdater; |
68 class PendingExtensionManager; | 68 class PendingExtensionManager; |
69 class SettingsFrontend; | 69 class SettingsFrontend; |
70 | |
71 namespace app_file_handler_util { | |
72 struct SavedFileEntry; | |
73 } | |
74 | |
75 } | 70 } |
76 | 71 |
77 namespace syncer { | 72 namespace syncer { |
78 class SyncErrorFactory; | 73 class SyncErrorFactory; |
79 } | 74 } |
80 | 75 |
81 // This is an interface class to encapsulate the dependencies that | 76 // This is an interface class to encapsulate the dependencies that |
82 // various classes have on ExtensionService. This allows easy mocking. | 77 // various classes have on ExtensionService. This allows easy mocking. |
83 class ExtensionServiceInterface : public syncer::SyncableService { | 78 class ExtensionServiceInterface : public syncer::SyncableService { |
84 public: | 79 public: |
(...skipping 709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
794 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); | 789 NaClModuleInfoList::iterator FindNaClModule(const GURL& url); |
795 | 790 |
796 // Performs tasks requested to occur after |extension| loads. | 791 // Performs tasks requested to occur after |extension| loads. |
797 void DoPostLoadTasks(const extensions::Extension* extension); | 792 void DoPostLoadTasks(const extensions::Extension* extension); |
798 | 793 |
799 // Launches the platform app associated with |extension_host|. | 794 // Launches the platform app associated with |extension_host|. |
800 static void LaunchApplication(extensions::ExtensionHost* extension_host); | 795 static void LaunchApplication(extensions::ExtensionHost* extension_host); |
801 | 796 |
802 // Dispatches a restart event to the platform app associated with | 797 // Dispatches a restart event to the platform app associated with |
803 // |extension_host|. | 798 // |extension_host|. |
804 static void RestartApplication( | 799 static void RestartApplication(extensions::ExtensionHost* extension_host); |
805 std::vector<extensions::app_file_handler_util::SavedFileEntry> | |
806 file_entries, | |
807 extensions::ExtensionHost* extension_host); | |
808 | 800 |
809 // Helper to inspect an ExtensionHost after it has been loaded. | 801 // Helper to inspect an ExtensionHost after it has been loaded. |
810 void InspectExtensionHost(extensions::ExtensionHost* host); | 802 void InspectExtensionHost(extensions::ExtensionHost* host); |
811 | 803 |
812 // Helper to determine whether we should initially enable an installed | 804 // Helper to determine whether we should initially enable an installed |
813 // (or upgraded) extension. | 805 // (or upgraded) extension. |
814 bool ShouldEnableOnInstall(const extensions::Extension* extension); | 806 bool ShouldEnableOnInstall(const extensions::Extension* extension); |
815 | 807 |
816 // Helper to determine if an extension is idle, and it should be safe | 808 // Helper to determine if an extension is idle, and it should be safe |
817 // to update the extension. | 809 // to update the extension. |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 | 913 |
922 // Map of inspector cookies that are detached, waiting for an extension to be | 914 // Map of inspector cookies that are detached, waiting for an extension to be |
923 // reloaded. | 915 // reloaded. |
924 typedef std::map<std::string, std::string> OrphanedDevTools; | 916 typedef std::map<std::string, std::string> OrphanedDevTools; |
925 OrphanedDevTools orphaned_dev_tools_; | 917 OrphanedDevTools orphaned_dev_tools_; |
926 | 918 |
927 // Maps extension ids to a bitmask that indicates which events should be | 919 // Maps extension ids to a bitmask that indicates which events should be |
928 // dispatched to the extension when it is loaded. | 920 // dispatched to the extension when it is loaded. |
929 std::map<std::string, int> on_load_events_; | 921 std::map<std::string, int> on_load_events_; |
930 | 922 |
931 // Maps extension ids to vectors of saved file entries that the extension | |
932 // should be given access to on restart. | |
933 typedef std::map<std::string, | |
934 std::vector<extensions::app_file_handler_util::SavedFileEntry> > | |
935 SavedFileEntryMap; | |
936 SavedFileEntryMap on_restart_file_entries_; | |
937 | |
938 content::NotificationRegistrar registrar_; | 923 content::NotificationRegistrar registrar_; |
939 PrefChangeRegistrar pref_change_registrar_; | 924 PrefChangeRegistrar pref_change_registrar_; |
940 | 925 |
941 // Keeps track of loading and unloading component extensions. | 926 // Keeps track of loading and unloading component extensions. |
942 scoped_ptr<extensions::ComponentLoader> component_loader_; | 927 scoped_ptr<extensions::ComponentLoader> component_loader_; |
943 | 928 |
944 // Keeps track of menu items added by extensions. | 929 // Keeps track of menu items added by extensions. |
945 extensions::MenuManager menu_manager_; | 930 extensions::MenuManager menu_manager_; |
946 | 931 |
947 // Flag to make sure event routers are only initialized once. | 932 // Flag to make sure event routers are only initialized once. |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
998 ObserverList<extensions::UpdateObserver, true> update_observers_; | 983 ObserverList<extensions::UpdateObserver, true> update_observers_; |
999 | 984 |
1000 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 985 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1001 InstallAppsWithUnlimtedStorage); | 986 InstallAppsWithUnlimtedStorage); |
1002 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 987 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1003 InstallAppsAndCheckStorageProtection); | 988 InstallAppsAndCheckStorageProtection); |
1004 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 989 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
1005 }; | 990 }; |
1006 | 991 |
1007 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 992 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |