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 "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 244 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 DCHECK(delegate); | 255 DCHECK(delegate); |
256 DCHECK(params); | 256 DCHECK(params); |
257 DCHECK(proxy_.get() == NULL); | 257 DCHECK(proxy_.get() == NULL); |
258 | 258 |
259 // We *must* create automationproxy in a thread that has message loop, | 259 // We *must* create automationproxy in a thread that has message loop, |
260 // since SyncChannel::Context construction registers event to be watched | 260 // since SyncChannel::Context construction registers event to be watched |
261 // through ObjectWatcher which subscribes for the current thread message loop | 261 // through ObjectWatcher which subscribes for the current thread message loop |
262 // destruction notification. | 262 // destruction notification. |
263 | 263 |
264 // At same time we must destroy/stop the thread from another thread. | 264 // At same time we must destroy/stop the thread from another thread. |
265 std::string channel_id = AutomationProxy::GenerateChannelID(); | |
266 ChromeFrameAutomationProxyImpl* proxy = | 265 ChromeFrameAutomationProxyImpl* proxy = |
267 new ChromeFrameAutomationProxyImpl(this, params->launch_timeout()); | 266 new ChromeFrameAutomationProxyImpl(this, params->launch_timeout()); |
268 proxy->InitializeChannel(channel_id, false); | |
269 | 267 |
270 // Ensure that the automation proxy actually respects our choice on whether | 268 // Ensure that the automation proxy actually respects our choice on whether |
271 // or not to check the version. | 269 // or not to check the version. |
272 proxy->set_perform_version_check(params->version_check()); | 270 proxy->set_perform_version_check(params->version_check()); |
273 | 271 |
274 // Launch browser | 272 // Launch browser |
275 scoped_ptr<CommandLine> command_line( | 273 scoped_ptr<CommandLine> command_line( |
276 chrome_launcher::CreateLaunchCommandLine()); | 274 chrome_launcher::CreateLaunchCommandLine()); |
277 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, | 275 command_line->AppendSwitchASCII(switches::kAutomationClientChannelID, |
278 channel_id); | 276 proxy->channel_id()); |
279 | 277 |
280 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths | 278 // Run Chrome in Chrome Frame mode. In practice, this modifies the paths |
281 // and registry keys that Chrome looks in via the BrowserDistribution | 279 // and registry keys that Chrome looks in via the BrowserDistribution |
282 // mechanism. | 280 // mechanism. |
283 command_line->AppendSwitch(switches::kChromeFrame); | 281 command_line->AppendSwitch(switches::kChromeFrame); |
284 | 282 |
285 // Chrome Frame never wants Chrome to start up with a First Run UI. | 283 // Chrome Frame never wants Chrome to start up with a First Run UI. |
286 command_line->AppendSwitch(switches::kNoFirstRun); | 284 command_line->AppendSwitch(switches::kNoFirstRun); |
287 | 285 |
288 command_line->AppendSwitch(switches::kDisablePopupBlocking); | 286 command_line->AppendSwitch(switches::kDisablePopupBlocking); |
(...skipping 1170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1459 const URLRequestStatus& status) { | 1457 const URLRequestStatus& status) { |
1460 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), | 1458 automation_server_->Send(new AutomationMsg_RequestEnd(0, tab_->handle(), |
1461 request_id, status)); | 1459 request_id, status)); |
1462 } | 1460 } |
1463 | 1461 |
1464 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, | 1462 void ChromeFrameAutomationClient::OnCookiesRetrieved(bool success, |
1465 const GURL& url, const std::string& cookie_string, int cookie_id) { | 1463 const GURL& url, const std::string& cookie_string, int cookie_id) { |
1466 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, | 1464 automation_server_->Send(new AutomationMsg_GetCookiesHostResponse(0, |
1467 tab_->handle(), success, url, cookie_string, cookie_id)); | 1465 tab_->handle(), success, url, cookie_string, cookie_id)); |
1468 } | 1466 } |
OLD | NEW |