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

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: 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/common/chrome_result_codes.h » ('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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after
1151 parsed_command_line().HasSwitch(switches::kShowIcons)) { 1151 parsed_command_line().HasSwitch(switches::kShowIcons)) {
1152 return ChromeBrowserMainPartsWin::HandleIconsCommands( 1152 return ChromeBrowserMainPartsWin::HandleIconsCommands(
1153 parsed_command_line_); 1153 parsed_command_line_);
1154 } 1154 }
1155 1155
1156 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory( 1156 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory(
1157 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); 1157 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO)));
1158 #endif // defined(OS_WIN) 1158 #endif // defined(OS_WIN)
1159 1159
1160 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) { 1160 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) {
1161 bool is_managed = g_browser_process->local_state()->IsManagedPreference(
1162 prefs::kDefaultBrowserSettingEnabled);
1163 if (is_managed && !g_browser_process->local_state()->GetBoolean(
1164 prefs::kDefaultBrowserSettingEnabled)) {
1165 return static_cast<int>(chrome::RESULT_CODE_ACTION_DISALLOWED_BY_POLICY);
1166 }
1167
1161 return ShellIntegration::SetAsDefaultBrowser() ? 1168 return ShellIntegration::SetAsDefaultBrowser() ?
1162 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : 1169 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) :
jochen (gone - plz use gerrit) 2015/03/20 14:49:14 unrelated change?
peletskyi 2015/03/24 14:00:27 Done.
1163 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); 1170 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED);
1164 } 1171 }
1165 1172
1166 #if defined(USE_AURA) 1173 #if defined(USE_AURA)
1167 // Make sure aura::Env has been initialized. 1174 // Make sure aura::Env has been initialized.
1168 CHECK(aura::Env::GetInstance()); 1175 CHECK(aura::Env::GetInstance());
1169 #endif // defined(USE_AURA) 1176 #endif // defined(USE_AURA)
1170 1177
1171 // Android doesn't support extensions and doesn't implement ProcessSingleton. 1178 // Android doesn't support extensions and doesn't implement ProcessSingleton.
1172 #if !defined(OS_ANDROID) 1179 #if !defined(OS_ANDROID)
1173 // If the command line specifies --pack-extension, attempt the pack extension 1180 // If the command line specifies --pack-extension, attempt the pack extension
(...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after
1728 chromeos::CrosSettings::Shutdown(); 1735 chromeos::CrosSettings::Shutdown();
1729 #endif // defined(OS_CHROMEOS) 1736 #endif // defined(OS_CHROMEOS)
1730 #endif // defined(OS_ANDROID) 1737 #endif // defined(OS_ANDROID)
1731 } 1738 }
1732 1739
1733 // Public members: 1740 // Public members:
1734 1741
1735 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 1742 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
1736 chrome_extra_parts_.push_back(parts); 1743 chrome_extra_parts_.push_back(parts);
1737 } 1744 }
OLDNEW
« 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