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 <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 // deletion is done or at least is scheduled. | 272 // deletion is done or at least is scheduled. |
273 virtual bool UninstallExtension(const std::string& extension_id, | 273 virtual bool UninstallExtension(const std::string& extension_id, |
274 extensions::UninstallReason reason, | 274 extensions::UninstallReason reason, |
275 const base::Closure& deletion_done_callback, | 275 const base::Closure& deletion_done_callback, |
276 base::string16* error); | 276 base::string16* error); |
277 | 277 |
278 // Enables the extension. If the extension is already enabled, does | 278 // Enables the extension. If the extension is already enabled, does |
279 // nothing. | 279 // nothing. |
280 virtual void EnableExtension(const std::string& extension_id); | 280 virtual void EnableExtension(const std::string& extension_id); |
281 | 281 |
282 // Disables the extension. If the extension is already disabled, or | 282 // Disables the extension. If the extension is already disabled, just adds |
283 // cannot be disabled, does nothing. | 283 // the |disable_reasons| (a bitmask of Extension::DisableReason - there can |
284 virtual void DisableExtension( | 284 // be multiple DisableReasons e.g. when an extension comes in disabled from |
285 const std::string& extension_id, | 285 // Sync). If the extension cannot be disabled (due to policy), does nothing. |
286 extensions::Extension::DisableReason disable_reason); | 286 virtual void DisableExtension(const std::string& extension_id, |
| 287 int disable_reasons); |
287 | 288 |
288 // Disable non-default and non-managed extensions with ids not in | 289 // Disable non-default and non-managed extensions with ids not in |
289 // |except_ids|. Default extensions are those from the Web Store with | 290 // |except_ids|. Default extensions are those from the Web Store with |
290 // |was_installed_by_default| flag. | 291 // |was_installed_by_default| flag. |
291 void DisableUserExtensions(const std::vector<std::string>& except_ids); | 292 void DisableUserExtensions(const std::vector<std::string>& except_ids); |
292 | 293 |
293 // Puts all extensions in a blocked state: Unloading every extension, and | 294 // Puts all extensions in a blocked state: Unloading every extension, and |
294 // preventing them from ever loading until UnblockAllExtensions is called. | 295 // preventing them from ever loading until UnblockAllExtensions is called. |
295 // This state is stored in preferences, so persists until Chrome restarts. | 296 // This state is stored in preferences, so persists until Chrome restarts. |
296 // | 297 // |
(...skipping 466 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 GreylistUnknownDontChange); | 764 GreylistUnknownDontChange); |
764 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 765 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
765 ManagementPolicyProhibitsEnableOnInstalled); | 766 ManagementPolicyProhibitsEnableOnInstalled); |
766 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 767 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
767 BlockAndUnblockBlacklistedExtension); | 768 BlockAndUnblockBlacklistedExtension); |
768 | 769 |
769 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 770 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
770 }; | 771 }; |
771 | 772 |
772 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 773 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
OLD | NEW |