Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(538)

Unified Diff: ui/gfx/screen.h

Issue 8382019: Move DisplayUtils methods into gfx::Screen. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove DCHECKS Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/gfx/screen.h
diff --git a/ui/gfx/screen.h b/ui/gfx/screen.h
index 0c712d47ea2bd1879536673b696f6656ecc03372..45a15adf3cb4e78e6acefd7593377de16d031377 100644
--- a/ui/gfx/screen.h
+++ b/ui/gfx/screen.h
@@ -9,6 +9,7 @@
#include "ui/gfx/native_widget_types.h"
#include "ui/gfx/point.h"
#include "ui/gfx/rect.h"
+#include "ui/gfx/size.h"
namespace gfx {
@@ -26,6 +27,7 @@ class UI_EXPORT Screen {
static void SetInstance(Screen* screen);
#endif
+ // Returns the current absolute position of the mouse pointer.
static gfx::Point GetCursorScreenPoint();
// Returns the work area of the monitor nearest the specified window.
@@ -44,6 +46,14 @@ class UI_EXPORT Screen {
// Returns the window under the cursor.
static gfx::NativeWindow GetWindowAtCursorScreenPoint();
+ // Returns the dimensions of the primary monitor in pixels.
+ static gfx::Size GetPrimaryMonitorSize();
+
+ // Returns the number of monitors.
+ // Mirrored displays are excluded; this method is intended to return the
+ // number of distinct, usable displays.
+ static int GetNumMonitors();
+
protected:
virtual gfx::Point GetCursorScreenPointImpl() = 0;
virtual gfx::Rect GetMonitorWorkAreaNearestWindowImpl(
@@ -54,6 +64,8 @@ class UI_EXPORT Screen {
const gfx::Point& point) = 0;
virtual gfx::Rect GetMonitorAreaNearestPointImpl(const gfx::Point& point) = 0;
virtual gfx::NativeWindow GetWindowAtCursorScreenPointImpl() = 0;
+ virtual gfx::Size GetPrimaryMonitorSizeImpl() = 0;
+ virtual int GetNumMonitorsImpl() = 0;
private:
#if defined(USE_AURA)
« no previous file with comments | « ui/aura/screen_aura.cc ('k') | ui/gfx/screen_aura.cc » ('j') | ui/ui_unittests.gypi » ('J')

Powered by Google App Engine
This is Rietveld 408576698