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 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // TODO(aa): This method can be removed. ExtensionUpdater could use | 186 // TODO(aa): This method can be removed. ExtensionUpdater could use |
187 // CrxInstaller directly instead. | 187 // CrxInstaller directly instead. |
188 virtual bool UpdateExtension( | 188 virtual bool UpdateExtension( |
189 const std::string& id, | 189 const std::string& id, |
190 const base::FilePath& extension_path, | 190 const base::FilePath& extension_path, |
191 bool file_ownership_passed, | 191 bool file_ownership_passed, |
192 extensions::CrxInstaller** out_crx_installer) OVERRIDE; | 192 extensions::CrxInstaller** out_crx_installer) OVERRIDE; |
193 | 193 |
194 // Reloads the specified extension, sending the onLaunched() event to it if it | 194 // Reloads the specified extension, sending the onLaunched() event to it if it |
195 // currently has any window showing. | 195 // currently has any window showing. |
196 void ReloadExtension(const std::string extension_id); | 196 void ReloadExtension(const std::string& extension_id); |
197 | 197 |
198 // Uninstalls the specified extension. Callers should only call this method | 198 // Uninstalls the specified extension. Callers should only call this method |
199 // with extensions that exist. |external_uninstall| is a magical parameter | 199 // with extensions that exist. |external_uninstall| is a magical parameter |
200 // that is only used to send information to ExtensionPrefs, which external | 200 // that is only used to send information to ExtensionPrefs, which external |
201 // callers should never set to true. | 201 // callers should never set to true. |
202 // | 202 // |
203 // We pass the |extension_id| by value to avoid having it deleted from under | |
204 // us incase someone calls it with Extension::id() or another string that we | |
205 // are going to delete in this function. | |
206 // | |
207 // TODO(aa): Remove |external_uninstall| -- this information should be passed | 203 // TODO(aa): Remove |external_uninstall| -- this information should be passed |
208 // to ExtensionPrefs some other way. | 204 // to ExtensionPrefs some other way. |
209 virtual bool UninstallExtension(const std::string& extension_id, | 205 virtual bool UninstallExtension(const std::string& extension_id, |
210 bool external_uninstall, | 206 bool external_uninstall, |
211 base::string16* error); | 207 base::string16* error); |
212 | 208 |
213 virtual bool IsExtensionEnabled( | 209 virtual bool IsExtensionEnabled( |
214 const std::string& extension_id) const OVERRIDE; | 210 const std::string& extension_id) const OVERRIDE; |
215 | 211 |
216 // Enables the extension. If the extension is already enabled, does | 212 // Enables the extension. If the extension is already enabled, does |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
694 InstallAppsWithUnlimtedStorage); | 690 InstallAppsWithUnlimtedStorage); |
695 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 691 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
696 InstallAppsAndCheckStorageProtection); | 692 InstallAppsAndCheckStorageProtection); |
697 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs); | 693 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, SetUnsetBlacklistInPrefs); |
698 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 694 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
699 BlacklistedExtensionWillNotInstall); | 695 BlacklistedExtensionWillNotInstall); |
700 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 696 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
701 UnloadBlacklistedExtensionPolicy); | 697 UnloadBlacklistedExtensionPolicy); |
702 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 698 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
703 WillNotLoadBlacklistedExtensionsFromDirectory); | 699 WillNotLoadBlacklistedExtensionsFromDirectory); |
704 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 700 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, ReloadBlacklistedExtension); |
705 BlacklistedInPrefsFromStartup); | 701 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, BlacklistedInPrefsFromStartup); |
706 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 702 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
707 GreylistedExtensionDisabled); | 703 GreylistedExtensionDisabled); |
708 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 704 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
709 GreylistDontEnableManuallyDisabled); | 705 GreylistDontEnableManuallyDisabled); |
710 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 706 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
711 GreylistUnknownDontChange); | 707 GreylistUnknownDontChange); |
712 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 708 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
713 }; | 709 }; |
714 | 710 |
715 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 711 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |