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

Unified Diff: chrome/browser/ui/webui/options/browser_options_handler.cc

Issue 1749813002: Fixes hidden "Set Default Browser" button when group policy is enabled (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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 | « no previous file | chrome/browser/ui/webui/settings/settings_default_browser_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options/browser_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/browser_options_handler.cc b/chrome/browser/ui/webui/options/browser_options_handler.cc
index 04d0fae50087fe068362b418b5b6f0e0d94d1f98..689bf89c8a19132716b00beb02a2d0b2e285eb54 100644
--- a/chrome/browser/ui/webui/options/browser_options_handler.cc
+++ b/chrome/browser/ui/webui/options/browser_options_handler.cc
@@ -173,6 +173,10 @@ void AppendExtensionData(const std::string& key,
}
#endif // defined(OS_WIN)
+bool IsDisabledByPolicy(const BooleanPrefMember& pref) {
+ return pref.IsManaged() && !pref.GetValue();
+}
+
} // namespace
namespace options {
@@ -1098,7 +1102,7 @@ void BrowserOptionsHandler::UpdateDefaultBrowserState() {
void BrowserOptionsHandler::BecomeDefaultBrowser(const base::ListValue* args) {
// If the default browser setting is managed then we should not be able to
// call this function.
- if (default_browser_policy_.IsManaged())
+ if (IsDisabledByPolicy(default_browser_policy_))
return;
content::RecordAction(UserMetricsAction("Options_SetAsDefaultBrowser"));
@@ -1157,7 +1161,7 @@ void BrowserOptionsHandler::SetDefaultBrowserUIString(int status_string_id) {
status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT);
base::FundamentalValue can_be_default(
- !default_browser_policy_.IsManaged() &&
+ !IsDisabledByPolicy(default_browser_policy_) &&
(status_string_id == IDS_OPTIONS_DEFAULTBROWSER_DEFAULT ||
status_string_id == IDS_OPTIONS_DEFAULTBROWSER_NOTDEFAULT));
« no previous file with comments | « no previous file | chrome/browser/ui/webui/settings/settings_default_browser_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698