Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2146)

Unified Diff: chrome/browser/extensions/test_management_policy.h

Issue 54903011: Add management policy function allowing extensions to be disabled. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: responded to review comments Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/test_management_policy.h
diff --git a/chrome/browser/extensions/test_management_policy.h b/chrome/browser/extensions/test_management_policy.h
index 07adaeff88c76d18b6d68f43d7c927732ff20ff1..00dc98bf422ed1e3311ca4fe358a4a6957146024 100644
--- a/chrome/browser/extensions/test_management_policy.h
+++ b/chrome/browser/extensions/test_management_policy.h
@@ -12,6 +12,7 @@
#include "chrome/browser/extensions/management_policy.h"
namespace extensions {
+
// This class provides a simple way to create providers with specific
// restrictions and a known error message, for use in testing.
class TestManagementPolicyProvider : public ManagementPolicy::Provider {
@@ -20,7 +21,8 @@ class TestManagementPolicyProvider : public ManagementPolicy::Provider {
ALLOW_ALL = 0,
PROHIBIT_LOAD = 1 << 0,
PROHIBIT_MODIFY_STATUS = 1 << 1,
- MUST_REMAIN_ENABLED = 1 << 2
+ MUST_REMAIN_ENABLED = 1 << 2,
+ MUST_REMAIN_DISABLED = 1 << 3
};
static std::string expected_error() {
@@ -31,6 +33,7 @@ class TestManagementPolicyProvider : public ManagementPolicy::Provider {
explicit TestManagementPolicyProvider(int prohibited_actions);
void SetProhibitedActions(int prohibited_actions);
+ void SetDisableReason(Extension::DisableReason reason);
virtual std::string GetDebugPolicyProviderName() const OVERRIDE;
@@ -43,12 +46,20 @@ class TestManagementPolicyProvider : public ManagementPolicy::Provider {
virtual bool MustRemainEnabled(const Extension* extension,
string16* error) const OVERRIDE;
+ virtual bool MustRemainDisabled(const Extension* extension,
+ Extension::DisableReason* reason,
+ string16* error) const OVERRIDE;
+
private:
bool may_load_;
bool may_modify_status_;
bool must_remain_enabled_;
+ bool must_remain_disabled_;
+ Extension::DisableReason disable_reason_;
string16 error_message_;
};
-} // namespace
+
+} // namespace extensions
+
#endif // CHROME_BROWSER_EXTENSIONS_TEST_MANAGEMENT_POLICY_H_
« no previous file with comments | « chrome/browser/extensions/management_policy_unittest.cc ('k') | chrome/browser/extensions/test_management_policy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698