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

Unified Diff: extensions/browser/test_management_policy.cc

Issue 536753003: Add recommended extension installation support (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ext-3
Patch Set: rebase, more fix Created 6 years, 2 months 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/test_management_policy.h ('k') | extensions/extensions_strings.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/test_management_policy.cc
diff --git a/extensions/browser/test_management_policy.cc b/extensions/browser/test_management_policy.cc
index 77ec19132f2a09db6fe54d4173dc29a9c4806d38..839fde6dc99b3c0c0034785a9b3fd47f56c2ee4b 100644
--- a/extensions/browser/test_management_policy.cc
+++ b/extensions/browser/test_management_policy.cc
@@ -13,6 +13,7 @@ TestManagementPolicyProvider::TestManagementPolicyProvider()
may_modify_status_(true),
must_remain_enabled_(false),
must_remain_disabled_(false),
+ must_remain_installed_(false),
disable_reason_(Extension::DISABLE_NONE) {
error_message_ = base::UTF8ToUTF16(expected_error());
}
@@ -29,6 +30,7 @@ void TestManagementPolicyProvider::SetProhibitedActions(
may_modify_status_ = (prohibited_actions & PROHIBIT_MODIFY_STATUS) == 0;
must_remain_enabled_ = (prohibited_actions & MUST_REMAIN_ENABLED) != 0;
must_remain_disabled_ = (prohibited_actions & MUST_REMAIN_DISABLED) != 0;
+ must_remain_installed_ = (prohibited_actions & MUST_REMAIN_INSTALLED) != 0;
}
void TestManagementPolicyProvider::SetDisableReason(
@@ -75,5 +77,12 @@ bool TestManagementPolicyProvider::MustRemainDisabled(
return must_remain_disabled_;
}
+bool TestManagementPolicyProvider::MustRemainInstalled(
+ const Extension* extension,
+ base::string16* error) const {
+ if (error && must_remain_installed_)
+ *error = error_message_;
+ return must_remain_installed_;
+}
} // namespace extensions
« no previous file with comments | « extensions/browser/test_management_policy.h ('k') | extensions/extensions_strings.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698