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

Unified Diff: extensions/browser/extension_prefs.cc

Issue 714133002: Add more management policy checking after extension installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove two tests Created 6 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
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/extension_prefs.cc
diff --git a/extensions/browser/extension_prefs.cc b/extensions/browser/extension_prefs.cc
index 4d476f52a408a5c429f06dbd2ebc0e38aa9ecb10..dc91d2ebd70c036a5c36be3264ab21c34c07574a 100644
--- a/extensions/browser/extension_prefs.cc
+++ b/extensions/browser/extension_prefs.cc
@@ -746,31 +746,36 @@ bool ExtensionPrefs::HasDisableReason(
void ExtensionPrefs::AddDisableReason(const std::string& extension_id,
Extension::DisableReason disable_reason) {
- ModifyDisableReason(extension_id, disable_reason, DISABLE_REASON_ADD);
+ ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_ADD);
+}
+
+void ExtensionPrefs::AddDisableReasons(const std::string& extension_id,
+ int disable_reasons) {
+ ModifyDisableReasons(extension_id, disable_reasons, DISABLE_REASON_ADD);
}
void ExtensionPrefs::RemoveDisableReason(
const std::string& extension_id,
Extension::DisableReason disable_reason) {
- ModifyDisableReason(extension_id, disable_reason, DISABLE_REASON_REMOVE);
+ ModifyDisableReasons(extension_id, disable_reason, DISABLE_REASON_REMOVE);
}
void ExtensionPrefs::ClearDisableReasons(const std::string& extension_id) {
- ModifyDisableReason(
- extension_id, Extension::DISABLE_NONE, DISABLE_REASON_CLEAR);
+ ModifyDisableReasons(extension_id, Extension::DISABLE_NONE,
+ DISABLE_REASON_CLEAR);
}
-void ExtensionPrefs::ModifyDisableReason(const std::string& extension_id,
- Extension::DisableReason reason,
- DisableReasonChange change) {
+void ExtensionPrefs::ModifyDisableReasons(const std::string& extension_id,
+ int reasons,
+ DisableReasonChange change) {
int old_value = GetDisableReasons(extension_id);
int new_value = old_value;
switch (change) {
case DISABLE_REASON_ADD:
- new_value |= static_cast<int>(reason);
+ new_value |= reasons;
break;
case DISABLE_REASON_REMOVE:
- new_value &= ~static_cast<int>(reason);
+ new_value &= ~reasons;
break;
case DISABLE_REASON_CLEAR:
new_value = Extension::DISABLE_NONE;
« no previous file with comments | « extensions/browser/extension_prefs.h ('k') | extensions/common/extension.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698