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

Unified Diff: ui/gfx/screen_win.cc

Issue 10540091: Rename gfx::Monitor to gfx::Display (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
« ui/gfx/screen.h ('K') | « ui/gfx/screen_mac.mm ('k') | ui/ui.gyp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/screen_win.cc
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc
index 3c868c6be7da57f55deb8155b7d58fefff0c925c..ee24bdd9bfe8a35a1642345f62c21fd1b6504a67 100644
--- a/ui/gfx/screen_win.cc
+++ b/ui/gfx/screen_win.cc
@@ -7,7 +7,7 @@
#include <windows.h>
#include "base/logging.h"
-#include "ui/gfx/monitor.h"
+#include "ui/gfx/display.h"
namespace {
@@ -18,11 +18,11 @@ MONITORINFO GetMonitorInfoForMonitor(HMONITOR monitor) {
return monitor_info;
}
-gfx::Monitor GetMonitor(MONITORINFO& monitor_info) {
+gfx::Display GetDisplay(MONITORINFO& monitor_info) {
// TODO(oshima): Implement ID and Observer.
- gfx::Monitor monitor(0, gfx::Rect(monitor_info.rcMonitor));
- monitor.set_work_area(gfx::Rect(monitor_info.rcWork));
- return monitor;
+ gfx::Display display(0, gfx::Rect(monitor_info.rcMonitor));
+ display.set_work_area(gfx::Rect(monitor_info.rcWork));
+ return display;
}
} // namespace
@@ -53,41 +53,41 @@ int Screen::GetNumMonitors() {
}
// static
-gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeView window) {
+gfx::Display Screen::GetMonitorNearestWindow(gfx::NativeView window) {
MONITORINFO monitor_info;
monitor_info.cbSize = sizeof(monitor_info);
GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST),
&monitor_info);
- return GetMonitor(monitor_info);
+ return GetDisplay(monitor_info);
}
// static
-gfx::Monitor Screen::GetMonitorNearestPoint(const gfx::Point& point) {
+gfx::Display Screen::GetMonitorNearestPoint(const gfx::Point& point) {
POINT initial_loc = { point.x(), point.y() };
HMONITOR monitor = MonitorFromPoint(initial_loc, MONITOR_DEFAULTTONEAREST);
MONITORINFO mi = {0};
mi.cbSize = sizeof(mi);
if (monitor && GetMonitorInfo(monitor, &mi))
- return GetMonitor(mi);
- return gfx::Monitor();
+ return GetDisplay(mi);
+ return gfx::Display();
}
// static
-gfx::Monitor Screen::GetPrimaryMonitor() {
+gfx::Display Screen::GetPrimaryMonitor() {
MONITORINFO mi = GetMonitorInfoForMonitor(
MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY));
- gfx::Monitor monitor = GetMonitor(mi);
- DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), monitor.size().width());
- DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), monitor.size().height());
- return monitor;
+ gfx::Display display = GetDisplay(mi);
+ DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width());
+ DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height());
+ return display;
}
// static
-gfx::Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
+gfx::Display Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
RECT other_bounds_rect = match_rect.ToRECT();
MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect(
&other_bounds_rect, MONITOR_DEFAULTTONEAREST));
- return GetMonitor(monitor_info);
+ return GetDisplay(monitor_info);
}
} // namespace gfx
« ui/gfx/screen.h ('K') | « ui/gfx/screen_mac.mm ('k') | ui/ui.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698