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_frame/cfproxy_private.h" | 5 #include "chrome_frame/cfproxy_private.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 #include "base/atomic_sequence_num.h" | 8 #include "base/atomic_sequence_num.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 | 268 |
269 static base::AtomicSequenceNumber g_proxy_channel_id(base::LINKER_INITIALIZED); | 269 static base::AtomicSequenceNumber g_proxy_channel_id(base::LINKER_INITIALIZED); |
270 std::string GenerateChannelId() { | 270 std::string GenerateChannelId() { |
271 return StringPrintf("ChromeTestingInterface:%u.%d", | 271 return StringPrintf("ChromeTestingInterface:%u.%d", |
272 base::GetCurrentProcId(), g_proxy_channel_id.GetNext() + 0xC000); | 272 base::GetCurrentProcId(), g_proxy_channel_id.GetNext() + 0xC000); |
273 } | 273 } |
274 | 274 |
275 std::wstring BuildCmdLine(const std::string& channel_id, | 275 std::wstring BuildCmdLine(const std::string& channel_id, |
276 const FilePath& profile_path, | 276 const FilePath& profile_path, |
277 const std::wstring& extra_args) { | 277 const std::wstring& extra_args) { |
278 scoped_ptr<CommandLine> command_line( | 278 std::wstring command_line_string; |
279 chrome_launcher::CreateLaunchCommandLine()); | 279 scoped_ptr<CommandLine> command_line; |
280 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, | 280 if (chrome_launcher::CreateLaunchCommandLine(&command_line)) { |
281 channel_id); | 281 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, |
282 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths | 282 channel_id); |
283 // and registry keys that Chrome looks in via the BrowserDistribution | 283 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths |
284 // mechanism. | 284 // and registry keys that Chrome looks in via the BrowserDistribution |
285 command_line->AppendSwitch(switches::kChromeFrame); | 285 // mechanism. |
286 // Chrome Frame never wants Chrome to start up with a First Run UI. | 286 command_line->AppendSwitch(switches::kChromeFrame); |
287 command_line->AppendSwitch(switches::kNoFirstRun); | 287 // Chrome Frame never wants Chrome to start up with a First Run UI. |
288 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 288 command_line->AppendSwitch(switches::kNoFirstRun); |
| 289 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
289 | 290 |
290 #ifndef NDEBUG | 291 #ifndef NDEBUG |
291 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very | 292 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very |
292 // useful for Chrome Frame users. | 293 // useful for Chrome Frame users. |
293 command_line->AppendSwitch(switches::kNoErrorDialogs); | 294 command_line->AppendSwitch(switches::kNoErrorDialogs); |
294 #endif | 295 #endif |
295 | 296 |
296 // In headless mode runs like reliability test runs we want full crash dumps | 297 // In headless mode runs like reliability test runs we want full crash dumps |
297 // from chrome. | 298 // from chrome. |
298 if (IsHeadlessMode()) | 299 if (IsHeadlessMode()) |
299 command_line->AppendSwitch(switches::kFullMemoryCrashReport); | 300 command_line->AppendSwitch(switches::kFullMemoryCrashReport); |
300 | 301 |
301 command_line->AppendSwitchPath(switches::kUserDataDir, profile_path); | 302 command_line->AppendSwitchPath(switches::kUserDataDir, profile_path); |
302 | 303 |
303 std::wstring command_line_string(command_line->GetCommandLineString()); | 304 command_line_string = command_line->GetCommandLineString(); |
304 if (!extra_args.empty()) { | 305 if (!extra_args.empty()) { |
305 command_line_string.append(L" "); | 306 command_line_string.append(L" "); |
306 command_line_string.append(extra_args); | 307 command_line_string.append(extra_args); |
| 308 } |
307 } | 309 } |
| 310 |
308 return command_line_string; | 311 return command_line_string; |
309 } | 312 } |
OLD | NEW |