Disable view source for Developer Tools.
[chromium-blink-merge.git] / chrome / test / automation / window_proxy.h
blob95bf0743e93c45210491c74ac2511c1f4bc707b3
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"
10 #if defined(OS_WIN)
11 #include <windows.h>
12 #endif
14 #include "base/strings/string16.h"
15 #include "base/threading/thread.h"
16 #include "chrome/test/automation/automation_handle_tracker.h"
18 class BrowserProxy;
19 class WindowProxy;
21 namespace gfx {
22 class Rect;
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 {
30 public:
31 WindowProxy(AutomationMessageSender* sender,
32 AutomationHandleTracker* tracker,
33 int handle)
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);
46 protected:
47 virtual ~WindowProxy() {}
48 private:
49 DISALLOW_COPY_AND_ASSIGN(WindowProxy);
52 #endif // CHROME_TEST_AUTOMATION_WINDOW_PROXY_H__