| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 VIEWS_SCREEN_H_ | 5 #ifndef VIEWS_SCREEN_H_ |
| 6 #define VIEWS_SCREEN_H_ | 6 #define VIEWS_SCREEN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "gfx/native_widget_types.h" | 9 #include "gfx/native_widget_types.h" |
| 10 #include "gfx/point.h" | 10 #include "gfx/point.h" |
| 11 #include "gfx/rect.h" | 11 #include "gfx/rect.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 | 14 |
| 15 // A utility class for getting various info about screen size, monitors, | 15 // A utility class for getting various info about screen size, monitors, |
| 16 // cursor position, etc. | 16 // cursor position, etc. |
| 17 // TODO(erikkay) add more of those methods here | 17 // TODO(erikkay) add more of those methods here |
| 18 class Screen { | 18 class Screen { |
| 19 public: | 19 public: |
| 20 static gfx::Point GetCursorScreenPoint(); | 20 static gfx::Point GetCursorScreenPoint(); |
| 21 | 21 |
| 22 // Returns the work area of the monitor nearest the specified window. | 22 // Returns the work area of the monitor nearest the specified window. |
| 23 static gfx::Rect GetMonitorWorkAreaNearestWindow(gfx::NativeView view); | 23 static gfx::Rect GetMonitorWorkAreaNearestWindow(gfx::NativeView view); |
| 24 | 24 |
| 25 // Returns the bounds of the monitor nearest the specified window. | 25 // Returns the bounds of the monitor nearest the specified window. |
| 26 static gfx::Rect GetMonitorAreaNearestWindow(gfx::NativeView view); | 26 static gfx::Rect GetMonitorAreaNearestWindow(gfx::NativeView view); |
| 27 | 27 |
| 28 // Returns the work area of the monitor nearest the specified point. |
| 29 static gfx::Rect GetMonitorWorkAreaNearestPoint(const gfx::Point& point); |
| 30 |
| 28 // Returns the monitor area (not the work area, but the complete bounds) of | 31 // Returns the monitor area (not the work area, but the complete bounds) of |
| 29 // the monitor nearest the specified point. | 32 // the monitor nearest the specified point. |
| 30 static gfx::Rect GetMonitorAreaNearestPoint(const gfx::Point& point); | 33 static gfx::Rect GetMonitorAreaNearestPoint(const gfx::Point& point); |
| 31 | 34 |
| 32 // Returns the window under the cursor. | 35 // Returns the window under the cursor. |
| 33 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); | 36 static gfx::NativeWindow GetWindowAtCursorScreenPoint(); |
| 34 }; | 37 }; |
| 35 | 38 |
| 36 } // namespace views | 39 } // namespace views |
| 37 | 40 |
| 38 #endif // VIEWS_SCREEN_H_ | 41 #endif // VIEWS_SCREEN_H_ |
| OLD | NEW |