OLD | NEW |
---|---|
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 1125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1136 parsed_command_line().HasSwitch(switches::kShowIcons)) { | 1136 parsed_command_line().HasSwitch(switches::kShowIcons)) { |
1137 return ChromeBrowserMainPartsWin::HandleIconsCommands( | 1137 return ChromeBrowserMainPartsWin::HandleIconsCommands( |
1138 parsed_command_line_); | 1138 parsed_command_line_); |
1139 } | 1139 } |
1140 | 1140 |
1141 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory( | 1141 ui::SelectFileDialog::SetFactory(new ChromeSelectFileDialogFactory( |
1142 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); | 1142 BrowserThread::GetMessageLoopProxyForThread(BrowserThread::IO))); |
1143 #endif | 1143 #endif |
1144 | 1144 |
1145 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) { | 1145 if (parsed_command_line().HasSwitch(switches::kMakeDefaultBrowser)) { |
1146 return ShellIntegration::SetAsDefaultBrowser() ? | 1146 bool is_managed = g_browser_process->local_state()->IsManagedPreference( |
1147 prefs::kDefaultBrowserSettingEnabled); | |
1148 if (!is_managed || | |
1149 g_browser_process->local_state()->GetBoolean( | |
1150 prefs::kDefaultBrowserSettingEnabled)) { | |
1151 return ShellIntegration::SetAsDefaultBrowser() ? | |
1147 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : | 1152 static_cast<int>(content::RESULT_CODE_NORMAL_EXIT) : |
1148 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); | 1153 static_cast<int>(chrome::RESULT_CODE_SHELL_INTEGRATION_FAILED); |
1154 } | |
1155 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
| |
1149 } | 1156 } |
1150 | 1157 |
1151 #if defined(USE_AURA) | 1158 #if defined(USE_AURA) |
1152 // Make sure aura::Env has been initialized. | 1159 // Make sure aura::Env has been initialized. |
1153 CHECK(aura::Env::GetInstance()); | 1160 CHECK(aura::Env::GetInstance()); |
1154 #endif | 1161 #endif |
1155 | 1162 |
1156 // Android doesn't support extensions and doesn't implement ProcessSingleton. | 1163 // Android doesn't support extensions and doesn't implement ProcessSingleton. |
1157 #if !defined(OS_ANDROID) | 1164 #if !defined(OS_ANDROID) |
1158 // If the command line specifies --pack-extension, attempt the pack extension | 1165 // If the command line specifies --pack-extension, attempt the pack extension |
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1708 chromeos::CrosSettings::Shutdown(); | 1715 chromeos::CrosSettings::Shutdown(); |
1709 #endif | 1716 #endif |
1710 #endif | 1717 #endif |
1711 } | 1718 } |
1712 | 1719 |
1713 // Public members: | 1720 // Public members: |
1714 | 1721 |
1715 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1722 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1716 chrome_extra_parts_.push_back(parts); | 1723 chrome_extra_parts_.push_back(parts); |
1717 } | 1724 } |
OLD | NEW |