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

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: Added new result code Created 5 years, 9 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/common/chrome_result_codes.h » ('j') | 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 1d362a634301b4178ce2a3d3f6b57a56dcf1a639..75e254fce4048caf62dde200c214d3448ec00c16 100644
--- a/chrome/browser/chrome_browser_main.cc
+++ b/chrome/browser/chrome_browser_main.cc
@@ -1158,9 +1158,15 @@ int ChromeBrowserMainParts::PreMainMessageLoopRunImpl() {
#endif // defined(OS_WIN)
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(
pastarmovj 2015/03/19 09:49:28 One last suggestion i got is to reverse the if con
peletskyi 2015/03/20 10:10:37 Done.
+ 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_ACTION_DISALLOWED_BY_POLICY);
}
#if defined(USE_AURA)
« no previous file with comments | « no previous file | chrome/common/chrome_result_codes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698