| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/trace_event.h" | 10 #include "base/trace_event.h" |
| (...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 | 273 |
| 274 // At same time we must destroy/stop the thread from another thread. | 274 // At same time we must destroy/stop the thread from another thread. |
| 275 ChromeFrameAutomationProxyImpl* proxy = | 275 ChromeFrameAutomationProxyImpl* proxy = |
| 276 new ChromeFrameAutomationProxyImpl( | 276 new ChromeFrameAutomationProxyImpl( |
| 277 params.automation_server_launch_timeout); | 277 params.automation_server_launch_timeout); |
| 278 | 278 |
| 279 // Launch browser | 279 // Launch browser |
| 280 scoped_ptr<CommandLine> command_line( | 280 scoped_ptr<CommandLine> command_line( |
| 281 chrome_launcher::CreateLaunchCommandLine()); | 281 chrome_launcher::CreateLaunchCommandLine()); |
| 282 command_line->AppendSwitchWithValue(switches::kAutomationClientChannelID, | 282 command_line->AppendSwitchWithValue(switches::kAutomationClientChannelID, |
| 283 ASCIIToWide(proxy->channel_id())); | 283 proxy->channel_id()); |
| 284 | 284 |
| 285 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths | 285 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths |
| 286 // and registry keys that Chrome looks in via the BrowserDistribution | 286 // and registry keys that Chrome looks in via the BrowserDistribution |
| 287 // mechanism. | 287 // mechanism. |
| 288 command_line->AppendSwitch(switches::kChromeFrame); | 288 command_line->AppendSwitch(switches::kChromeFrame); |
| 289 | 289 |
| 290 // Chrome Frame never wants Chrome to start up with a First Run UI. | 290 // Chrome Frame never wants Chrome to start up with a First Run UI. |
| 291 command_line->AppendSwitch(switches::kNoFirstRun); | 291 command_line->AppendSwitch(switches::kNoFirstRun); |
| 292 | 292 |
| 293 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 293 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
| 294 | 294 |
| 295 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very | 295 // Disable the "Whoa! Chrome has crashed." dialog, because that isn't very |
| 296 // useful for Chrome Frame users. | 296 // useful for Chrome Frame users. |
| 297 #ifndef NDEBUG | 297 #ifndef NDEBUG |
| 298 command_line->AppendSwitch(switches::kNoErrorDialogs); | 298 command_line->AppendSwitch(switches::kNoErrorDialogs); |
| 299 #endif | 299 #endif |
| 300 | 300 |
| 301 // In headless mode runs like reliability test runs we want full crash dumps | 301 // In headless mode runs like reliability test runs we want full crash dumps |
| 302 // from chrome. | 302 // from chrome. |
| 303 if (IsHeadlessMode()) | 303 if (IsHeadlessMode()) |
| 304 command_line->AppendSwitch(switches::kFullMemoryCrashReport); | 304 command_line->AppendSwitch(switches::kFullMemoryCrashReport); |
| 305 | 305 |
| 306 DLOG(INFO) << "Profile path: " << params.profile_path.value(); | 306 DLOG(INFO) << "Profile path: " << params.profile_path.value(); |
| 307 command_line->AppendSwitchWithValue(switches::kUserDataDir, | 307 command_line->AppendSwitchPath(switches::kUserDataDir, params.profile_path); |
| 308 params.profile_path.value()); | |
| 309 | 308 |
| 310 std::wstring command_line_string(command_line->command_line_string()); | 309 std::wstring command_line_string(command_line->command_line_string()); |
| 311 // If there are any extra arguments, append them to the command line. | 310 // If there are any extra arguments, append them to the command line. |
| 312 if (!params.extra_chrome_arguments.empty()) { | 311 if (!params.extra_chrome_arguments.empty()) { |
| 313 command_line_string += L' ' + params.extra_chrome_arguments; | 312 command_line_string += L' ' + params.extra_chrome_arguments; |
| 314 } | 313 } |
| 315 | 314 |
| 316 automation_server_launch_start_time_ = base::TimeTicks::Now(); | 315 automation_server_launch_start_time_ = base::TimeTicks::Now(); |
| 317 | 316 |
| 318 if (!base::LaunchApp(command_line_string, false, false, NULL)) { | 317 if (!base::LaunchApp(command_line_string, false, false, NULL)) { |
| (...skipping 958 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1277 const URLRequestStatus& status) { | 1276 const URLRequestStatus& status) { |
| 1278 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), | 1277 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), |
| 1279 request_id, status)); | 1278 request_id, status)); |
| 1280 } | 1279 } |
| 1281 | 1280 |
| 1282 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1281 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1283 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1282 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1284 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, | 1283 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, |
| 1285 tab_->handle(), success, url, cookie_string, cookie_id)); | 1284 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1286 } | 1285 } |
| OLD | NEW |