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 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
203 extensions::Blacklist* blacklist, | 203 extensions::Blacklist* blacklist, |
204 bool autoupdate_enabled, | 204 bool autoupdate_enabled, |
205 bool extensions_enabled); | 205 bool extensions_enabled); |
206 | 206 |
207 virtual ~ExtensionService(); | 207 virtual ~ExtensionService(); |
208 | 208 |
209 // Gets the list of currently installed extensions. | 209 // Gets the list of currently installed extensions. |
210 virtual const ExtensionSet* extensions() const OVERRIDE; | 210 virtual const ExtensionSet* extensions() const OVERRIDE; |
211 virtual const ExtensionSet* disabled_extensions() const OVERRIDE; | 211 virtual const ExtensionSet* disabled_extensions() const OVERRIDE; |
212 const ExtensionSet* terminated_extensions() const; | 212 const ExtensionSet* terminated_extensions() const; |
213 const ExtensionSet* blacklisted_extensions() const; | |
213 | 214 |
214 // Returns a set of all installed, disabled, and terminated extensions and | 215 // Returns a set of all installed, disabled, and terminated extensions. |
215 // transfers ownership to caller. | 216 scoped_ptr<const ExtensionSet> GenerateInstalledExtensionsSet() const; |
216 const ExtensionSet* GenerateInstalledExtensionsSet() const; | |
217 | 217 |
218 // Returns a set of all extensions disabled by the sideload wipeout | 218 // Returns a set of all extensions disabled by the sideload wipeout |
219 // initiative. | 219 // initiative. |
220 const ExtensionSet* GetWipedOutExtensions() const; | 220 scoped_ptr<const ExtensionSet> GetWipedOutExtensions() const; |
221 | 221 |
222 // Gets the object managing the set of pending extensions. | 222 // Gets the object managing the set of pending extensions. |
223 virtual extensions::PendingExtensionManager* | 223 virtual extensions::PendingExtensionManager* |
224 pending_extension_manager() OVERRIDE; | 224 pending_extension_manager() OVERRIDE; |
225 | 225 |
226 const FilePath& install_directory() const { return install_directory_; } | 226 const FilePath& install_directory() const { return install_directory_; } |
227 | 227 |
228 extensions::ProcessMap* process_map() { return &process_map_; } | 228 extensions::ProcessMap* process_map() { return &process_map_; } |
229 | 229 |
230 // Whether this extension can run in an incognito window. | 230 // Whether this extension can run in an incognito window. |
(...skipping 605 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
836 bool IsExtensionIdle(const std::string& extension_id) const; | 836 bool IsExtensionIdle(const std::string& extension_id) const; |
837 | 837 |
838 // Helper to determine if updating an extensions should proceed immediately, | 838 // Helper to determine if updating an extensions should proceed immediately, |
839 // or if we should delay the update until further notice. | 839 // or if we should delay the update until further notice. |
840 bool ShouldDelayExtensionUpdate(const std::string& extension_id, | 840 bool ShouldDelayExtensionUpdate(const std::string& extension_id, |
841 bool wait_for_idle) const; | 841 bool wait_for_idle) const; |
842 | 842 |
843 // extensions::Blacklist::Observer implementation. | 843 // extensions::Blacklist::Observer implementation. |
844 virtual void OnBlacklistUpdated() OVERRIDE; | 844 virtual void OnBlacklistUpdated() OVERRIDE; |
845 | 845 |
846 // Manages the blacklisted extensions, intended as callback from | |
847 // Blacklist::IsBlacklisted. | |
848 void ManageBlacklist(const std::set<std::string>& old_blacklisted_ids, | |
849 const std::set<std::string>& new_blacklisted_ids); | |
850 | |
846 // The normal profile associated with this ExtensionService. | 851 // The normal profile associated with this ExtensionService. |
847 Profile* profile_; | 852 Profile* profile_; |
848 | 853 |
849 // The ExtensionSystem for the profile above. | 854 // The ExtensionSystem for the profile above. |
850 extensions::ExtensionSystem* system_; | 855 extensions::ExtensionSystem* system_; |
851 | 856 |
852 // Preferences for the owning profile (weak reference). | 857 // Preferences for the owning profile (weak reference). |
853 extensions::ExtensionPrefs* extension_prefs_; | 858 extensions::ExtensionPrefs* extension_prefs_; |
854 | 859 |
860 // Blacklist for the owning profile (weak reference). | |
asargent_no_longer_on_chrome
2012/11/30 21:44:22
optional suggestion: Whenever I see "weak referenc
not at google - send to devlin
2012/11/30 23:09:54
Done.
TBH I thought the "weak reference" thing wa
asargent_no_longer_on_chrome
2012/11/30 23:30:25
Good point.
| |
861 extensions::Blacklist* blacklist_; | |
862 | |
855 // Settings for the owning profile. | 863 // Settings for the owning profile. |
856 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; | 864 scoped_ptr<extensions::SettingsFrontend> settings_frontend_; |
857 | 865 |
858 // The current list of installed extensions. | 866 // The current list of installed extensions. |
859 ExtensionSet extensions_; | 867 ExtensionSet extensions_; |
860 | 868 |
861 // The list of installed extensions that have been disabled. | 869 // The list of installed extensions that have been disabled. |
862 ExtensionSet disabled_extensions_; | 870 ExtensionSet disabled_extensions_; |
863 | 871 |
864 // The list of installed extensions that have been terminated. | 872 // The list of installed extensions that have been terminated. |
865 ExtensionSet terminated_extensions_; | 873 ExtensionSet terminated_extensions_; |
866 | 874 |
875 // The list of installed extensions that have been blacklisted. Generally | |
876 // these shouldn't be considered as installed by the extension platform: we | |
877 // only keep them around so that if extensions are blacklisted by mistake | |
878 // they can easily be un-blacklisted. | |
879 ExtensionSet blacklisted_extensions_; | |
880 | |
867 // The list of extension updates that are waiting to be installed. | 881 // The list of extension updates that are waiting to be installed. |
868 ExtensionSet pending_extension_updates_; | 882 ExtensionSet pending_extension_updates_; |
869 | 883 |
870 // Hold the set of pending extensions. | 884 // Hold the set of pending extensions. |
871 extensions::PendingExtensionManager pending_extension_manager_; | 885 extensions::PendingExtensionManager pending_extension_manager_; |
872 | 886 |
873 // The map of extension IDs to their runtime data. | 887 // The map of extension IDs to their runtime data. |
874 ExtensionRuntimeDataMap extension_runtime_data_; | 888 ExtensionRuntimeDataMap extension_runtime_data_; |
875 | 889 |
876 // The full path to the directory where extensions are installed. | 890 // The full path to the directory where extensions are installed. |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1005 #endif | 1019 #endif |
1006 | 1020 |
1007 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1021 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1008 InstallAppsWithUnlimtedStorage); | 1022 InstallAppsWithUnlimtedStorage); |
1009 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 1023 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
1010 InstallAppsAndCheckStorageProtection); | 1024 InstallAppsAndCheckStorageProtection); |
1011 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 1025 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
1012 }; | 1026 }; |
1013 | 1027 |
1014 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 1028 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |