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

Side by Side 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: Fixed test for chromeos and rebase Created 5 years, 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/policy/policy_startup_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <set> 7 #include <set>
8 #include <string> 8 #include <string>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1142 matching lines...) Expand 10 before | Expand all | Expand 10 after
1153 parsed_command_line().HasSwitch(switches::kShowIcons)) { 1153 parsed_command_line().HasSwitch(switches::kShowIcons)) {
1154 return ChromeBrowserMainPartsWin::HandleIconsCommands( 1154 return ChromeBrowserMainPartsWin::HandleIconsCommands(
1155 parsed_command_line_); 1155 parsed_command_line_);
1156 } 1156 }
1157 1157
1158 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory( 1158 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory(
1159 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 1159 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
1160 #endif // defined(OS_WIN) 1160 #endif // defined(OS_WIN)
1161 1161
1162 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) { 1162 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) {
1163 bool is_managed = g_browser_process->local_state()->IsManagedPreference(
1164 prefs::kDefaultBrowserSettingEnabled);
1165 if (is_managed && !g_browser_process->local_state()->GetBoolean(
1166 prefs::kDefaultBrowserSettingEnabled)) {
1167 return static_cast<int>(chrome::RESULT_CODE_ACTION_DISALLOWED_BY_POLICY);
1168 }
1169
1163 return ShellIntegration::SetAsDefaultBrowser() ? 1170 return ShellIntegration::SetAsDefaultBrowser() ?
1164 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : 1171 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) :
1165 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); 1172 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED);
1166 } 1173 }
1167 1174
1168 #if defined(USE_AURA) 1175 #if defined(USE_AURA)
1169 // Make sure aura::Env has been initialized. 1176 // Make sure aura::Env has been initialized.
1170 CHECK(aura::Env::GetInstance()); 1177 CHECK(aura::Env::GetInstance());
1171 #endif // defined(USE_AURA) 1178 #endif // defined(USE_AURA)
1172 1179
(...skipping 557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1730 chromeos::CrosSettings::Shutdown(); 1737 chromeos::CrosSettings::Shutdown();
1731 #endif // defined(OS_CHROMEOS) 1738 #endif // defined(OS_CHROMEOS)
1732 #endif // defined(OS_ANDROID) 1739 #endif // defined(OS_ANDROID)
1733 } 1740 }
1734 1741
1735 // Public members: 1742 // Public members:
1736 1743
1737 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1744 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1738 chrome_extra_parts_.push_back(parts); 1745 chrome_extra_parts_.push_back(parts);
1739 } 1746 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/policy/policy_startup_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698