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

Unified Diff: chrome/browser/chrome_browser_main.cc

Issue 927163002: Now command line flag does not beat Policy (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chrome_browser_main.cc
diff --git a/chrome/browser/chrome_browser_main.cc b/chrome/browser/chrome_browser_main.cc
index 75518a2f8d575ae0d583242e59e70fe639e4749f..f9f02840373e61a9604236c4a9abd033c5f9de65 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1143,9 +1143,16 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
#endif
if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) {
- return ShellIntegration::SetAsDefaultBrowser() ?
+ bool is_managed = g_browser_process->local_state()->IsManagedPreference(
+ prefs::kDefaultBrowserSettingEnabled);
+ if (!is_managed ||
+ g_browser_process->local_state()->GetBoolean(
+ prefs::kDefaultBrowserSettingEnabled)) {
+ return ShellIntegration::SetAsDefaultBrowser() ?
static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) :
static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED);
+ }
+ return static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED);
pastarmovj 2015/03/18 16:02:17 Any chance you can add a new error result code her
}
#if defined(USE_AURA)
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698