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

Unified Diff: ui/gfx/screen_mac.mm

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
Index: ui/gfx/screen_mac.mm
diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm
index a7957c2607be76d9aad82e9ce56c00e598a68614..6986b400295f6d4ae9e261b7fbd5e39c880e2e5a 100644
--- a/ui/gfx/screen_mac.mm
+++ b/ui/gfx/screen_mac.mm
@@ -12,7 +12,7 @@
@end
#include "base/logging.h"
-#include "ui/gfx/monitor.h"
+#include "ui/gfx/display.h"
namespace {
@@ -45,10 +45,10 @@ NSScreen* GetMatchingScreen(const gfx::Rect& match_rect) {
return max_screen;
}
-gfx::Monitor GetMonitorForScreen(NSScreen* screen, bool is_primary) {
+gfx::Display GetDisplayForScreen(NSScreen* screen, bool is_primary) {
NSRect frame = [screen frame];
// TODO(oshima): Implement ID and Observer.
- gfx::Monitor monitor(0, gfx::Rect(NSRectToCGRect(frame)));
+ gfx::Display display(0, gfx::Rect(NSRectToCGRect(frame)));
NSRect visible_frame = [screen visibleFrame];
@@ -57,17 +57,17 @@ gfx::Monitor GetMonitorForScreen(NSScreen* screen, bool is_primary) {
gfx::Rect work_area = gfx::Rect(NSRectToCGRect(visible_frame));
work_area.set_y(frame.size.height - visible_frame.origin.y -
visible_frame.size.height);
- monitor.set_work_area(work_area);
+ display.set_work_area(work_area);
} else {
- monitor.set_work_area(ConvertCoordinateSystem(visible_frame));
+ display.set_work_area(ConvertCoordinateSystem(visible_frame));
}
CGFloat scale;
if ([screen respondsToSelector:@selector(backingScaleFactor)])
scale = [screen backingScaleFactor];
else
scale = [screen userSpaceScaleFactor];
- monitor.set_device_scale_factor(scale);
- return monitor;
+ display.set_device_scale_factor(scale);
+ return display;
}
} // namespace
@@ -89,27 +89,27 @@ gfx::Point Screen::GetCursorScreenPoint() {
}
// static
-gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeView view) {
+gfx::Display Screen::GetMonitorNearestWindow(gfx::NativeView view) {
NSWindow* window = [view window];
if (!window)
return GetPrimaryMonitor();
NSScreen* match_screen = [window screen];
- return GetMonitorForScreen(match_screen, false /* may not be primary */);
+ return GetDisplayForScreen(match_screen, false /* may not be primary */);
}
// static
-gfx::Monitor Screen::GetPrimaryMonitor() {
- // Primary monitor is defined as the monitor with the menubar,
+gfx::Display Screen::GetPrimaryMonitor() {
+ // Primary display is defined as the display with the menubar,
// which is always at index 0.
NSScreen* primary = [[NSScreen screens] objectAtIndex:0];
- gfx::Monitor monitor = GetMonitorForScreen(primary, true /* primary */);
- return monitor;
+ gfx::Display display = GetDisplayForScreen(primary, true /* primary */);
+ return display;
}
// static
-gfx::Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
+gfx::Display Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
NSScreen* match_screen = GetMatchingScreen(match_rect);
- return GetMonitorForScreen(match_screen, false /* may not be primary */);
+ return GetDisplayForScreen(match_screen, false /* may not be primary */);
}
// static
« ui/gfx/screen.h ('K') | « ui/gfx/screen_impl.h ('k') | ui/gfx/screen_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698