| 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 #ifndef CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ | 5 #ifndef CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ |
| 6 #define CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ | 6 #define CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ |
| 7 | 7 |
| 8 #include "build/build_config.h" | 8 #include "build/build_config.h" |
| 9 | 9 |
| 10 #if defined(OS_WIN) | 10 #if defined(OS_WIN) |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 // This class presents the interface to actions that can be performed on a given | 27 // This class presents the interface to actions that can be performed on a given |
| 28 // window. Note that this object can be invalidated at any time if the | 28 // window. Note that this object can be invalidated at any time if the |
| 29 // corresponding window in the app is closed. In that case, any subsequent | 29 // corresponding window in the app is closed. In that case, any subsequent |
| 30 // calls will return false immediately. | 30 // calls will return false immediately. |
| 31 class WindowProxy : public AutomationResourceProxy { | 31 class WindowProxy : public AutomationResourceProxy { |
| 32 public: | 32 public: |
| 33 WindowProxy(AutomationMessageSender* sender, | 33 WindowProxy(AutomationMessageSender* sender, |
| 34 AutomationHandleTracker* tracker, | 34 AutomationHandleTracker* tracker, |
| 35 int handle) | 35 int handle) |
| 36 : AutomationResourceProxy(tracker, sender, handle) {} | 36 : AutomationResourceProxy(tracker, sender, handle) {} |
| 37 virtual ~WindowProxy() {} | |
| 38 | 37 |
| 39 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 40 // TODO(port): Use portable replacements for windowsisms. | 39 // TODO(port): Use portable replacements for windowsisms. |
| 41 | 40 |
| 42 // Gets the outermost HWND that corresponds to the given window. | 41 // Gets the outermost HWND that corresponds to the given window. |
| 43 // Returns true if the call was successful. | 42 // Returns true if the call was successful. |
| 44 bool GetHWND(HWND* handle) const; | 43 bool GetHWND(HWND* handle) const; |
| 45 | 44 |
| 46 // Simulates a click at the OS level. |click| is in the window's coordinates | 45 // Simulates a click at the OS level. |click| is in the window's coordinates |
| 47 // and |flags| specifies which buttons are pressed (as defined in | 46 // and |flags| specifies which buttons are pressed (as defined in |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 82 // bounds are obtained, and sets is_timeout accordingly. | 81 // bounds are obtained, and sets is_timeout accordingly. |
| 83 bool GetViewBoundsWithTimeout(int view_id, gfx::Rect* bounds, | 82 bool GetViewBoundsWithTimeout(int view_id, gfx::Rect* bounds, |
| 84 bool screen_coordinates, uint32 timeout_ms, | 83 bool screen_coordinates, uint32 timeout_ms, |
| 85 bool* is_timeout); | 84 bool* is_timeout); |
| 86 // Gets the id of the view that currently has focus. Returns true if the id | 85 // Gets the id of the view that currently has focus. Returns true if the id |
| 87 // was retrieved. | 86 // was retrieved. |
| 88 bool GetFocusedViewID(int* view_id); | 87 bool GetFocusedViewID(int* view_id); |
| 89 | 88 |
| 90 // Returns the browser this window corresponds to, or NULL if this window | 89 // Returns the browser this window corresponds to, or NULL if this window |
| 91 // is not a browser. The caller owns the returned BrowserProxy. | 90 // is not a browser. The caller owns the returned BrowserProxy. |
| 92 BrowserProxy* GetBrowser(); | 91 scoped_refptr<BrowserProxy> GetBrowser(); |
| 93 | 92 |
| 94 // Same as GetWindow except return NULL if response isn't received | 93 // Same as GetWindow except return NULL if response isn't received |
| 95 // before the specified timeout. | 94 // before the specified timeout. |
| 96 BrowserProxy* GetBrowserWithTimeout(uint32 timeout_ms, bool* is_timeout); | 95 scoped_refptr<BrowserProxy> GetBrowserWithTimeout(uint32 timeout_ms, |
| 97 | 96 bool* is_timeout); |
| 97 protected: |
| 98 virtual ~WindowProxy() {} |
| 98 private: | 99 private: |
| 99 DISALLOW_COPY_AND_ASSIGN(WindowProxy); | 100 DISALLOW_COPY_AND_ASSIGN(WindowProxy); |
| 100 }; | 101 }; |
| 101 | 102 |
| 102 #endif // CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ | 103 #endif // CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__ |
| OLD | NEW |