OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/environment.h" | 9 #include "base/environment.h" |
10 #include "base/event_recorder.h" | 10 #include "base/event_recorder.h" |
(...skipping 1106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1117 return false; | 1117 return false; |
1118 } | 1118 } |
1119 } | 1119 } |
1120 | 1120 |
1121 // If we have been invoked to display a desktop notification on behalf of | 1121 // If we have been invoked to display a desktop notification on behalf of |
1122 // the service process, we do not want to open any browser windows. | 1122 // the service process, we do not want to open any browser windows. |
1123 if (command_line.HasSwitch(switches::kNotifyCloudPrintTokenExpired)) { | 1123 if (command_line.HasSwitch(switches::kNotifyCloudPrintTokenExpired)) { |
1124 silent_launch = true; | 1124 silent_launch = true; |
1125 profile->GetCloudPrintProxyService()->ShowTokenExpiredNotification(); | 1125 profile->GetCloudPrintProxyService()->ShowTokenExpiredNotification(); |
1126 } | 1126 } |
| 1127 // If we are just displaying a print dialog we shouldn't open browser |
| 1128 // windows. |
| 1129 if (!command_line.GetSwitchValuePath(switches::kCloudPrintFile).empty()) { |
| 1130 silent_launch = true; |
| 1131 } |
| 1132 |
1127 | 1133 |
1128 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { | 1134 if (command_line.HasSwitch(switches::kExplicitlyAllowedPorts)) { |
1129 std::string allowed_ports = | 1135 std::string allowed_ports = |
1130 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); | 1136 command_line.GetSwitchValueASCII(switches::kExplicitlyAllowedPorts); |
1131 net::SetExplicitlyAllowedPorts(allowed_ports); | 1137 net::SetExplicitlyAllowedPorts(allowed_ports); |
1132 } | 1138 } |
1133 | 1139 |
1134 #if defined(OS_CHROMEOS) | 1140 #if defined(OS_CHROMEOS) |
1135 // The browser will be launched after the user logs in. | 1141 // The browser will be launched after the user logs in. |
1136 if (command_line.HasSwitch(switches::kLoginManager) || | 1142 if (command_line.HasSwitch(switches::kLoginManager) || |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 return false; | 1189 return false; |
1184 automation->SetExpectedTabCount(expected_tabs); | 1190 automation->SetExpectedTabCount(expected_tabs); |
1185 | 1191 |
1186 AutomationProviderList* list = | 1192 AutomationProviderList* list = |
1187 g_browser_process->InitAutomationProviderList(); | 1193 g_browser_process->InitAutomationProviderList(); |
1188 DCHECK(list); | 1194 DCHECK(list); |
1189 list->AddProvider(automation); | 1195 list->AddProvider(automation); |
1190 | 1196 |
1191 return true; | 1197 return true; |
1192 } | 1198 } |
OLD | NEW |