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
3 // found in the LICENSE file.
5 #ifndef CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__
6 #define CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__
8 #include "build/build_config.h"
14 #include "base/strings/string16.h"
15 #include "base/threading/thread.h"
16 #include "chrome/test/automation/automation_handle_tracker.h"
25 // This class presents the interface to actions that can be performed on a given
26 // window. Note that this object can be invalidated at any time if the
27 // corresponding window in the app is closed. In that case, any subsequent
28 // calls will return false immediately.
29 class WindowProxy
: public AutomationResourceProxy
{
31 WindowProxy(AutomationMessageSender
* sender
,
32 AutomationHandleTracker
* tracker
,
34 : AutomationResourceProxy(tracker
, sender
, handle
) {}
36 // Gets the bounds (in window coordinates) that correspond to the view with
37 // the given ID in this window. Returns true if bounds could be obtained.
38 // If |screen_coordinates| is true, the bounds are returned in the coordinates
39 // of the screen, if false in the coordinates of the browser.
40 bool GetViewBounds(int view_id
, gfx::Rect
* bounds
, bool screen_coordinates
);
42 // Sets the position and size of the window. Returns true if setting the
43 // bounds was successful.
44 bool SetBounds(const gfx::Rect
& bounds
);
47 virtual ~WindowProxy() {}
49 DISALLOW_COPY_AND_ASSIGN(WindowProxy
);
52 #endif // CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__