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/test/automation/automation_proxy.h" | 5 #include "chrome/test/automation/automation_proxy.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/debug/trace_event.h" | 10 #include "base/debug/trace_event.h" |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 | 324 |
325 scoped_refptr<BrowserProxy> AutomationProxy::GetBrowserWindow( | 325 scoped_refptr<BrowserProxy> AutomationProxy::GetBrowserWindow( |
326 int window_index) { | 326 int window_index) { |
327 int handle = 0; | 327 int handle = 0; |
328 if (!Send(new AutomationMsg_BrowserWindow(window_index, &handle))) | 328 if (!Send(new AutomationMsg_BrowserWindow(window_index, &handle))) |
329 return NULL; | 329 return NULL; |
330 | 330 |
331 return ProxyObjectFromHandle<BrowserProxy>(handle); | 331 return ProxyObjectFromHandle<BrowserProxy>(handle); |
332 } | 332 } |
333 | 333 |
334 scoped_refptr<BrowserProxy> AutomationProxy::FindTabbedBrowserWindow() { | |
335 int handle = 0; | |
336 if (!Send(new AutomationMsg_FindTabbedBrowserWindow(&handle))) | |
337 return NULL; | |
338 | |
339 return ProxyObjectFromHandle<BrowserProxy>(handle); | |
340 } | |
341 | |
342 IPC::SyncChannel* AutomationProxy::channel() { | 334 IPC::SyncChannel* AutomationProxy::channel() { |
343 return channel_.get(); | 335 return channel_.get(); |
344 } | 336 } |
345 | 337 |
346 bool AutomationProxy::Send(IPC::Message* message) { | 338 bool AutomationProxy::Send(IPC::Message* message) { |
347 return Send(message, | 339 return Send(message, |
348 static_cast<int>(action_timeout_.InMilliseconds())); | 340 static_cast<int>(action_timeout_.InMilliseconds())); |
349 } | 341 } |
350 | 342 |
351 bool AutomationProxy::Send(IPC::Message* message, int timeout_ms) { | 343 bool AutomationProxy::Send(IPC::Message* message, int timeout_ms) { |
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
480 } | 472 } |
481 | 473 |
482 bool AutomationProxy::SendJSONRequest(const std::string& request, | 474 bool AutomationProxy::SendJSONRequest(const std::string& request, |
483 int timeout_ms, | 475 int timeout_ms, |
484 std::string* response) { | 476 std::string* response) { |
485 bool result = false; | 477 bool result = false; |
486 if (!SendAutomationJSONRequest(this, request, timeout_ms, response, &result)) | 478 if (!SendAutomationJSONRequest(this, request, timeout_ms, response, &result)) |
487 return false; | 479 return false; |
488 return result; | 480 return result; |
489 } | 481 } |
OLD | NEW |