| 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/chrome_frame_automation.h" | 5 #include "chrome_frame/chrome_frame_automation.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/bind_helpers.h" | 8 #include "base/bind_helpers.h" |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 291 params->profile_path()); | 291 params->profile_path()); |
| 292 | 292 |
| 293 // Ensure that Chrome is running the specified version of chrome.dll. | 293 // Ensure that Chrome is running the specified version of chrome.dll. |
| 294 command_line->AppendSwitchNative(switches::kChromeVersion, | 294 command_line->AppendSwitchNative(switches::kChromeVersion, |
| 295 GetCurrentModuleVersion()); | 295 GetCurrentModuleVersion()); |
| 296 | 296 |
| 297 if (!params->language().empty()) | 297 if (!params->language().empty()) |
| 298 command_line->AppendSwitchNative(switches::kLang, params->language()); | 298 command_line->AppendSwitchNative(switches::kLang, params->language()); |
| 299 | 299 |
| 300 command_line_string = command_line->GetCommandLineString(); | 300 command_line_string = command_line->GetCommandLineString(); |
| 301 // If there are any extra arguments, append them to the command line. | |
| 302 if (!params->extra_arguments().empty()) { | |
| 303 command_line_string += L' ' + params->extra_arguments(); | |
| 304 } | |
| 305 } | 301 } |
| 306 | 302 |
| 307 automation_server_launch_start_time_ = base::TimeTicks::Now(); | 303 automation_server_launch_start_time_ = base::TimeTicks::Now(); |
| 308 | 304 |
| 309 if (command_line_string.empty() || | 305 if (command_line_string.empty() || |
| 310 !base::LaunchProcess(command_line_string, base::LaunchOptions(), NULL)) { | 306 !base::LaunchProcess(command_line_string, base::LaunchOptions(), NULL)) { |
| 311 // We have no code for launch failure. | 307 // We have no code for launch failure. |
| 312 launch_result_ = AUTOMATION_LAUNCH_RESULT_INVALID; | 308 launch_result_ = AUTOMATION_LAUNCH_RESULT_INVALID; |
| 313 } else { | 309 } else { |
| 314 // Launch timeout may happen if the new instance tries to communicate | 310 // Launch timeout may happen if the new instance tries to communicate |
| (...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 663 // Important: Since we will be using the referrer_ variable from a | 659 // Important: Since we will be using the referrer_ variable from a |
| 664 // different thread, we need to force a new std::string buffer instance for | 660 // different thread, we need to force a new std::string buffer instance for |
| 665 // the referrer_ GURL variable. Otherwise we can run into strangeness when | 661 // the referrer_ GURL variable. Otherwise we can run into strangeness when |
| 666 // the GURL is accessed and it could result in a bad URL that can cause the | 662 // the GURL is accessed and it could result in a bad URL that can cause the |
| 667 // referrer to be dropped or something worse. | 663 // referrer to be dropped or something worse. |
| 668 GURL referrer_gurl(referrer.c_str()); | 664 GURL referrer_gurl(referrer.c_str()); |
| 669 if (!chrome_launch_params_) { | 665 if (!chrome_launch_params_) { |
| 670 FilePath profile_path; | 666 FilePath profile_path; |
| 671 chrome_launch_params_ = new ChromeFrameLaunchParams(parsed_url, | 667 chrome_launch_params_ = new ChromeFrameLaunchParams(parsed_url, |
| 672 referrer_gurl, profile_path, L"", SimpleResourceLoader::GetLanguage(), | 668 referrer_gurl, profile_path, L"", SimpleResourceLoader::GetLanguage(), |
| 673 L"", false, false, route_all_top_level_navigations_); | 669 false, false, route_all_top_level_navigations_); |
| 674 } else { | 670 } else { |
| 675 chrome_launch_params_->set_referrer(referrer_gurl); | 671 chrome_launch_params_->set_referrer(referrer_gurl); |
| 676 chrome_launch_params_->set_url(parsed_url); | 672 chrome_launch_params_->set_url(parsed_url); |
| 677 } | 673 } |
| 678 | 674 |
| 679 navigate_after_initialization_ = false; | 675 navigate_after_initialization_ = false; |
| 680 | 676 |
| 681 if (is_initialized()) { | 677 if (is_initialized()) { |
| 682 BeginNavigate(); | 678 BeginNavigate(); |
| 683 } else { | 679 } else { |
| (...skipping 590 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1274 const net::URLRequestStatus& status) { | 1270 const net::URLRequestStatus& status) { |
| 1275 automation_server_->Send(new AutomationMsg_RequestEnd( | 1271 automation_server_->Send(new AutomationMsg_RequestEnd( |
| 1276 tab_->handle(), request_id, status)); | 1272 tab_->handle(), request_id, status)); |
| 1277 } | 1273 } |
| 1278 | 1274 |
| 1279 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1275 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1280 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1276 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1281 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1277 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
| 1282 tab_->handle(), success, url, cookie_string, cookie_id)); | 1278 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1283 } | 1279 } |
| OLD | NEW |