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 "app/app_switches.h" | 7 #include "app/app_switches.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
(...skipping 992 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1003 | 1003 |
1004 void ChromeFrameAutomationClient::SetEnableExtensionAutomation( | 1004 void ChromeFrameAutomationClient::SetEnableExtensionAutomation( |
1005 const std::vector<std::string>& functions_enabled) { | 1005 const std::vector<std::string>& functions_enabled) { |
1006 if (!is_initialized()) | 1006 if (!is_initialized()) |
1007 return; | 1007 return; |
1008 | 1008 |
1009 // We are doing initialization, so there is no need to reset extension | 1009 // We are doing initialization, so there is no need to reset extension |
1010 // automation, only to set it. Also, we want to avoid resetting extension | 1010 // automation, only to set it. Also, we want to avoid resetting extension |
1011 // automation that some other automation client has set up. Therefore only | 1011 // automation that some other automation client has set up. Therefore only |
1012 // send the message if we are going to enable automation of some functions. | 1012 // send the message if we are going to enable automation of some functions. |
1013 if (functions_enabled.size() > 0) { | 1013 if (!functions_enabled.empty()) |
1014 tab_->SetEnableExtensionAutomation(functions_enabled); | 1014 tab_->SetEnableExtensionAutomation(functions_enabled); |
1015 } | |
1016 } | 1015 } |
1017 | 1016 |
1018 // Invoked in launch background thread. | 1017 // Invoked in launch background thread. |
1019 void ChromeFrameAutomationClient::LaunchComplete( | 1018 void ChromeFrameAutomationClient::LaunchComplete( |
1020 ChromeFrameAutomationProxy* proxy, | 1019 ChromeFrameAutomationProxy* proxy, |
1021 AutomationLaunchResult result) { | 1020 AutomationLaunchResult result) { |
1022 // If we're shutting down we don't keep a pointer to the automation server. | 1021 // If we're shutting down we don't keep a pointer to the automation server. |
1023 if (init_state_ != UNINITIALIZING) { | 1022 if (init_state_ != UNINITIALIZING) { |
1024 DCHECK(init_state_ == INITIALIZING); | 1023 DCHECK(init_state_ == INITIALIZING); |
1025 automation_server_ = proxy; | 1024 automation_server_ = proxy; |
(...skipping 438 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1464 const net::URLRequestStatus& status) { | 1463 const net::URLRequestStatus& status) { |
1465 automation_server_->Send(new AutomationMsg_RequestEnd( | 1464 automation_server_->Send(new AutomationMsg_RequestEnd( |
1466 tab_->handle(), request_id, status)); | 1465 tab_->handle(), request_id, status)); |
1467 } | 1466 } |
1468 | 1467 |
1469 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1468 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
1470 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1469 const GURL& url, const std::string& cookie_string, int cookie_id) { |
1471 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1470 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
1472 tab_->handle(), success, url, cookie_string, cookie_id)); | 1471 tab_->handle(), success, url, cookie_string, cookie_id)); |
1473 } | 1472 } |
OLD | NEW |