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 1140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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); | |
pastarmovj
2015/03/20 10:57:04
nit: indentation.
peletskyi
2015/03/20 11:02:02
Done.
| |
1163 if (is_managed && !g_browser_process->local_state()->GetBoolean( | |
1164 prefs::kDefaultBrowserSettingEnabled)) { | |
pastarmovj
2015/03/20 10:57:04
nit: indentation.
peletskyi
2015/03/20 11:02:02
Done.
| |
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) : |
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 Loading... | |
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 } |
OLD | NEW |