| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 127 break; | 127 break; |
| 128 default: | 128 default: |
| 129 NOTREACHED(); | 129 NOTREACHED(); |
| 130 } | 130 } |
| 131 return true; | 131 return true; |
| 132 } | 132 } |
| 133 }; | 133 }; |
| 134 | 134 |
| 135 ChromeFrameAutomationProxyImpl::ChromeFrameAutomationProxyImpl( | 135 ChromeFrameAutomationProxyImpl::ChromeFrameAutomationProxyImpl( |
| 136 AutomationProxyCacheEntry* entry, | 136 AutomationProxyCacheEntry* entry, |
| 137 std::string channel_id, int launch_timeout) | 137 std::string channel_id, base::TimeDelta launch_timeout) |
| 138 : AutomationProxy(launch_timeout, false), proxy_entry_(entry) { | 138 : AutomationProxy(launch_timeout, false), proxy_entry_(entry) { |
| 139 TRACE_EVENT_BEGIN_ETW("chromeframe.automationproxy", this, ""); | 139 TRACE_EVENT_BEGIN_ETW("chromeframe.automationproxy", this, ""); |
| 140 | 140 |
| 141 InitializeChannel(channel_id, false); | 141 InitializeChannel(channel_id, false); |
| 142 | 142 |
| 143 sync_ = new CFMsgDispatcher(); | 143 sync_ = new CFMsgDispatcher(); |
| 144 message_filter_ = new TabProxyNotificationMessageFilter(tracker_.get()); | 144 message_filter_ = new TabProxyNotificationMessageFilter(tracker_.get()); |
| 145 | 145 |
| 146 // Order of filters is not important. | 146 // Order of filters is not important. |
| 147 channel_->AddFilter(message_filter_.get()); | 147 channel_->AddFilter(message_filter_.get()); |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 DCHECK(proxy_.get() == NULL); | 244 DCHECK(proxy_.get() == NULL); |
| 245 | 245 |
| 246 // We *must* create automationproxy in a thread that has message loop, | 246 // We *must* create automationproxy in a thread that has message loop, |
| 247 // since SyncChannel::Context construction registers event to be watched | 247 // since SyncChannel::Context construction registers event to be watched |
| 248 // through ObjectWatcher which subscribes for the current thread message loop | 248 // through ObjectWatcher which subscribes for the current thread message loop |
| 249 // destruction notification. | 249 // destruction notification. |
| 250 | 250 |
| 251 // At same time we must destroy/stop the thread from another thread. | 251 // At same time we must destroy/stop the thread from another thread. |
| 252 std::string channel_id = AutomationProxy::GenerateChannelID(); | 252 std::string channel_id = AutomationProxy::GenerateChannelID(); |
| 253 ChromeFrameAutomationProxyImpl* proxy = | 253 ChromeFrameAutomationProxyImpl* proxy = |
| 254 new ChromeFrameAutomationProxyImpl(this, channel_id, | 254 new ChromeFrameAutomationProxyImpl( |
| 255 params->launch_timeout()); | 255 this, |
| 256 channel_id, |
| 257 base::TimeDelta::FromMilliseconds(params->launch_timeout())); |
| 256 | 258 |
| 257 // Ensure that the automation proxy actually respects our choice on whether | 259 // Ensure that the automation proxy actually respects our choice on whether |
| 258 // or not to check the version. | 260 // or not to check the version. |
| 259 proxy->set_perform_version_check(params->version_check()); | 261 proxy->set_perform_version_check(params->version_check()); |
| 260 | 262 |
| 261 // Launch browser | 263 // Launch browser |
| 262 std::wstring command_line_string; | 264 std::wstring command_line_string; |
| 263 scoped_ptr<CommandLine> command_line; | 265 scoped_ptr<CommandLine> command_line; |
| 264 if (chrome_launcher::CreateLaunchCommandLine(&command_line)) { | 266 if (chrome_launcher::CreateLaunchCommandLine(&command_line)) { |
| 265 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, | 267 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, |
| (...skipping 1066 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1332 const net::URLRequestStatus& status) { | 1334 const net::URLRequestStatus& status) { |
| 1333 automation_server_->Send(new AutomationMsg_RequestEnd( | 1335 automation_server_->Send(new AutomationMsg_RequestEnd( |
| 1334 tab_->handle(), request_id, status)); | 1336 tab_->handle(), request_id, status)); |
| 1335 } | 1337 } |
| 1336 | 1338 |
| 1337 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1339 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
| 1338 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1340 const GURL& url, const std::string& cookie_string, int cookie_id) { |
| 1339 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( | 1341 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse( |
| 1340 tab_->handle(), success, url, cookie_string, cookie_id)); | 1342 tab_->handle(), success, url, cookie_string, cookie_id)); |
| 1341 } | 1343 } |
| OLD | NEW |