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 #ifndef UI_GFX_SCREEN_H_ | 5 #ifndef UI_GFX_SCREEN_H_ |
6 #define UI_GFX_SCREEN_H_ | 6 #define UI_GFX_SCREEN_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "ui/base/ui_export.h" | 9 #include "ui/base/ui_export.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 virtual ~Screen() {} | 22 virtual ~Screen() {} |
23 | 23 |
24 #if defined(USE_AURA) | 24 #if defined(USE_AURA) |
25 // Sets the instance to use. This takes owernship of |screen|, deleting the | 25 // Sets the instance to use. This takes owernship of |screen|, deleting the |
26 // old instance. This is used on aura to avoid circular dependencies between | 26 // old instance. This is used on aura to avoid circular dependencies between |
27 // ui and aura. | 27 // ui and aura. |
28 static void SetInstance(ScreenImpl* screen); | 28 static void SetInstance(ScreenImpl* screen); |
29 #endif | 29 #endif |
30 | 30 |
| 31 // Returns true if DIP is enabled. |
| 32 static bool IsDIPEnabled(); |
| 33 |
31 // Returns the current absolute position of the mouse pointer. | 34 // Returns the current absolute position of the mouse pointer. |
32 static gfx::Point GetCursorScreenPoint(); | 35 static gfx::Point GetCursorScreenPoint(); |
33 | 36 |
34 // Returns the window under the cursor. | 37 // Returns the window under the cursor. |
35 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); | 38 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); |
36 | 39 |
37 // Returns the number of monitors. | 40 // Returns the number of monitors. |
38 // Mirrored displays are excluded; this method is intended to return the | 41 // Mirrored displays are excluded; this method is intended to return the |
39 // number of distinct, usable displays. | 42 // number of distinct, usable displays. |
40 static int GetNumMonitors(); | 43 static int GetNumMonitors(); |
41 | 44 |
42 // Returns the monitor nearest the specified window. | 45 // Returns the monitor nearest the specified window. |
43 static gfx::Monitor GetMonitorNearestWindow(gfx::NativeView view); | 46 static gfx::Monitor GetMonitorNearestWindow(gfx::NativeView view); |
44 | 47 |
45 // Returns the the monitor nearest the specified point. | 48 // Returns the the monitor nearest the specified point. |
46 static gfx::Monitor GetMonitorNearestPoint(const gfx::Point& point); | 49 static gfx::Monitor GetMonitorNearestPoint(const gfx::Point& point); |
47 | 50 |
48 // Returns the bounds of the work area of the primary monitor. | 51 // Returns the bounds of the work area of the primary monitor. |
49 static gfx::Monitor GetPrimaryMonitor(); | 52 static gfx::Monitor GetPrimaryMonitor(); |
50 | 53 |
51 // Returns the monitor that most closely intersects the provided bounds. | 54 // Returns the monitor that most closely intersects the provided bounds. |
52 static gfx::Monitor GetMonitorMatching(const gfx::Rect& match_rect); | 55 static gfx::Monitor GetMonitorMatching(const gfx::Rect& match_rect); |
53 }; | 56 }; |
54 | 57 |
55 } // namespace gfx | 58 } // namespace gfx |
56 | 59 |
57 #endif // VIEWS_SCREEN_H_ | 60 #endif // VIEWS_SCREEN_H_ |
OLD | NEW |