Chromium Code Reviews| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 288 // cannot be disabled, does nothing. | 288 // cannot be disabled, does nothing. |
| 289 virtual void DisableExtension( | 289 virtual void DisableExtension( |
| 290 const std::string& extension_id, | 290 const std::string& extension_id, |
| 291 extensions::Extension::DisableReason disable_reason); | 291 extensions::Extension::DisableReason disable_reason); |
| 292 | 292 |
| 293 // Disable non-default and non-managed extensions with ids not in | 293 // Disable non-default and non-managed extensions with ids not in |
| 294 // |except_ids|. Default extensions are those from the Web Store with | 294 // |except_ids|. Default extensions are those from the Web Store with |
| 295 // |was_installed_by_default| flag. | 295 // |was_installed_by_default| flag. |
| 296 void DisableUserExtensions(const std::vector<std::string>& except_ids); | 296 void DisableUserExtensions(const std::vector<std::string>& except_ids); |
| 297 | 297 |
| 298 // Extensions that are not locked, components or forced by policy should be | |
| 299 // locked. Extensions are no longer considered enabled, disabled or | |
| 300 // terminated. Blacklisted extensions are now considered both blacklisted and | |
| 301 // blocked. | |
|
not at google - send to devlin
2014/11/12 23:41:43
Comment should explain what this method is suppose
Mike Lerman
2014/11/13 15:30:05
Done, although I've never been an Oxford Comma man
| |
| 302 void BlockAllExtensions(); | |
| 303 | |
| 304 // All blocked extensions should revert to being either enabled, disabled or | |
| 305 // terminated as appropriate. | |
| 306 void UnblockAllBlockedExtensions(); | |
|
not at google - send to devlin
2014/11/12 23:41:43
I think just "UnblockAllExtensions" is fine. And y
Mike Lerman
2014/11/13 15:30:05
Done.
| |
| 298 // Updates the |extension|'s granted permissions lists to include all | 307 // Updates the |extension|'s granted permissions lists to include all |
| 299 // permissions in the |extension|'s manifest and re-enables the | 308 // permissions in the |extension|'s manifest and re-enables the |
| 300 // extension. | 309 // extension. |
| 301 void GrantPermissionsAndEnableExtension( | 310 void GrantPermissionsAndEnableExtension( |
| 302 const extensions::Extension* extension); | 311 const extensions::Extension* extension); |
| 303 | 312 |
| 304 // Updates the |extension|'s granted permissions lists to include all | 313 // Updates the |extension|'s granted permissions lists to include all |
| 305 // permissions in the |extensions|'s manifest. | 314 // permissions in the |extensions|'s manifest. |
| 306 void GrantPermissions(const extensions::Extension* extension); | 315 void GrantPermissions(const extensions::Extension* extension); |
| 307 | 316 |
| (...skipping 236 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 544 void CheckPermissionsIncrease(const extensions::Extension* extension, | 553 void CheckPermissionsIncrease(const extensions::Extension* extension, |
| 545 bool is_extension_installed); | 554 bool is_extension_installed); |
| 546 | 555 |
| 547 // Helper that updates the active extension list used for crash reporting. | 556 // Helper that updates the active extension list used for crash reporting. |
| 548 void UpdateActiveExtensionsInCrashReporter(); | 557 void UpdateActiveExtensionsInCrashReporter(); |
| 549 | 558 |
| 550 // Helper to determine whether we should initially enable an installed | 559 // Helper to determine whether we should initially enable an installed |
| 551 // (or upgraded) extension. | 560 // (or upgraded) extension. |
| 552 bool ShouldEnableOnInstall(const extensions::Extension* extension); | 561 bool ShouldEnableOnInstall(const extensions::Extension* extension); |
| 553 | 562 |
| 563 // Helper method to determine if an extension can be blocked. | |
| 564 bool CanBlockExtension(const extensions::Extension* extension); | |
| 565 | |
| 554 // Helper to determine if updating an extensions should proceed immediately, | 566 // Helper to determine if updating an extensions should proceed immediately, |
| 555 // or if we should delay the update until further notice. | 567 // or if we should delay the update until further notice. |
| 556 bool ShouldDelayExtensionUpdate(const std::string& extension_id, | 568 bool ShouldDelayExtensionUpdate(const std::string& extension_id, |
| 557 bool install_immediately) const; | 569 bool install_immediately) const; |
| 558 | 570 |
| 559 // Manages the blacklisted extensions, intended as callback from | 571 // Manages the blacklisted extensions, intended as callback from |
| 560 // Blacklist::GetBlacklistedIDs. | 572 // Blacklist::GetBlacklistedIDs. |
| 561 void ManageBlacklist( | 573 void ManageBlacklist( |
| 562 const extensions::Blacklist::BlacklistStateMap& blacklisted_ids); | 574 const extensions::Blacklist::BlacklistStateMap& blacklisted_ids); |
| 563 | 575 |
| (...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 682 // allow background processing of garbage collection of on-disk state without | 694 // allow background processing of garbage collection of on-disk state without |
| 683 // needing to worry about race conditions caused by extension installation and | 695 // needing to worry about race conditions caused by extension installation and |
| 684 // reinstallation. | 696 // reinstallation. |
| 685 bool installs_delayed_for_gc_; | 697 bool installs_delayed_for_gc_; |
| 686 | 698 |
| 687 // Set to true if this is the first time this ExtensionService has run. | 699 // Set to true if this is the first time this ExtensionService has run. |
| 688 // Used for specially handling external extensions that are installed the | 700 // Used for specially handling external extensions that are installed the |
| 689 // first time. | 701 // first time. |
| 690 bool is_first_run_; | 702 bool is_first_run_; |
| 691 | 703 |
| 704 // Set to true if extensions are all to be blocked. | |
| 705 bool block_extensions_; | |
| 706 | |
| 692 // Store the ids of reloading extensions. We use this to re-enable extensions | 707 // Store the ids of reloading extensions. We use this to re-enable extensions |
| 693 // which were disabled for a reload. | 708 // which were disabled for a reload. |
| 694 std::set<std::string> reloading_extensions_; | 709 std::set<std::string> reloading_extensions_; |
| 695 | 710 |
| 696 // A set of the extension ids currently being terminated. We use this to | 711 // A set of the extension ids currently being terminated. We use this to |
| 697 // avoid trying to unload the same extension twice. | 712 // avoid trying to unload the same extension twice. |
| 698 std::set<std::string> extensions_being_terminated_; | 713 std::set<std::string> extensions_being_terminated_; |
| 699 | 714 |
| 700 // The controller for the UI that alerts the user about any blacklisted | 715 // The controller for the UI that alerts the user about any blacklisted |
| 701 // extensions. | 716 // extensions. |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 733 GreylistedExtensionDisabled); | 748 GreylistedExtensionDisabled); |
| 734 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 749 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 735 GreylistDontEnableManuallyDisabled); | 750 GreylistDontEnableManuallyDisabled); |
| 736 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, | 751 FRIEND_TEST_ALL_PREFIXES(ExtensionServiceTest, |
| 737 GreylistUnknownDontChange); | 752 GreylistUnknownDontChange); |
| 738 | 753 |
| 739 DISALLOW_COPY_AND_ASSIGN(ExtensionService); | 754 DISALLOW_COPY_AND_ASSIGN(ExtensionService); |
| 740 }; | 755 }; |
| 741 | 756 |
| 742 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ | 757 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_SERVICE_H_ |
| OLD | NEW |