| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/window_proxy.h" | 5 #include "chrome/test/automation/window_proxy.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 #include <algorithm> | 8 #include <algorithm> |
| 9 | 9 |
| 10 #include "base/gfx/rect.h" | 10 #include "base/gfx/rect.h" |
| 11 #include "base/logging.h" | 11 #include "base/logging.h" |
| 12 #include "chrome/test/automation/automation_constants.h" | 12 #include "chrome/test/automation/automation_constants.h" |
| 13 #include "chrome/test/automation/automation_messages.h" | 13 #include "chrome/test/automation/automation_messages.h" |
| 14 #include "chrome/test/automation/automation_proxy.h" | 14 #include "chrome/test/automation/automation_proxy.h" |
| 15 #include "chrome/test/automation/browser_proxy.h" | 15 #include "chrome/test/automation/browser_proxy.h" |
| 16 #include "chrome/test/automation/tab_proxy.h" | 16 #include "chrome/test/automation/tab_proxy.h" |
| 17 #include "googleurl/src/gurl.h" | 17 #include "googleurl/src/gurl.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) |
| 20 bool WindowProxy::GetHWND(HWND* handle) const { | 20 bool WindowProxy::GetHWND(HWND* handle) const { |
| 21 if (!is_valid()) return false; | 21 if (!is_valid()) return false; |
| 22 | 22 |
| 23 if (!handle) { | 23 if (!handle) { |
| 24 NOTREACHED(); | 24 NOTREACHED(); |
| 25 return false; | 25 return false; |
| 26 } | 26 } |
| 27 | 27 |
| 28 return sender_->Send(new AutomationMsg_WindowHWND(0, handle_, handle)); | 28 return sender_->Send(new AutomationMsg_WindowHWND(0, handle_, handle)); |
| 29 } | 29 } |
| 30 #endif // defined(OS_WIN) |
| 30 | 31 |
| 31 bool WindowProxy::SimulateOSClick(const POINT& click, int flags) { | 32 bool WindowProxy::SimulateOSClick(const gfx::Point& click, int flags) { |
| 32 if (!is_valid()) return false; | 33 if (!is_valid()) return false; |
| 33 | 34 |
| 34 return sender_->Send( | 35 return sender_->Send( |
| 35 new AutomationMsg_WindowClick(0, handle_, click, flags)); | 36 new AutomationMsg_WindowClick(0, handle_, click, flags)); |
| 36 } | 37 } |
| 37 #endif // defined(OS_WIN) | |
| 38 | 38 |
| 39 bool WindowProxy::GetWindowTitle(string16* text) { | 39 bool WindowProxy::GetWindowTitle(string16* text) { |
| 40 if (!is_valid()) return false; | 40 if (!is_valid()) return false; |
| 41 | 41 |
| 42 if (!text) { | 42 if (!text) { |
| 43 NOTREACHED(); | 43 NOTREACHED(); |
| 44 return false; | 44 return false; |
| 45 } | 45 } |
| 46 | 46 |
| 47 return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); | 47 return sender_->Send(new AutomationMsg_WindowTitle(0, handle_, text)); |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 149 if (!browser) { | 149 if (!browser) { |
| 150 browser = new BrowserProxy(sender_, tracker_, browser_handle); | 150 browser = new BrowserProxy(sender_, tracker_, browser_handle); |
| 151 browser->AddRef(); | 151 browser->AddRef(); |
| 152 } | 152 } |
| 153 | 153 |
| 154 // Since there is no scoped_refptr::attach. | 154 // Since there is no scoped_refptr::attach. |
| 155 scoped_refptr<BrowserProxy> result; | 155 scoped_refptr<BrowserProxy> result; |
| 156 result.swap(&browser); | 156 result.swap(&browser); |
| 157 return result; | 157 return result; |
| 158 } | 158 } |
| OLD | NEW |