summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-08 15:33:19 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-08 15:33:19 +0000
commit42482096dad0c715c59a3dc47e8ee26a1bcb4b28 (patch)
tree410579dfd931276987aaa717640fd0f8df4cf25c /ui
parent594842ef04f40e20daa300e992be8a1507852b48 (diff)
downloadchromium_src-42482096dad0c715c59a3dc47e8ee26a1bcb4b28.zip
chromium_src-42482096dad0c715c59a3dc47e8ee26a1bcb4b28.tar.gz
chromium_src-42482096dad0c715c59a3dc47e8ee26a1bcb4b28.tar.bz2
mac: Basic HighDPI implementation for web contents.
Depends on https://bugs.webkit.org/show_bug.cgi?id=88596 The basics work, but a lot of stuff is broken (e.g. switching resolutions while chrome is running). BUG=31960 TEST=Go HighDPI, launch chrome. No longer pixely. TBR=sky Review URL: https://chromiumcodereview.appspot.com/10537067 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@141211 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/screen_mac.mm9
-rw-r--r--ui/gfx/screen_win.cc2
2 files changed, 10 insertions, 1 deletions
diff --git a/ui/gfx/screen_mac.mm b/ui/gfx/screen_mac.mm
index 0bbed90..a7957c2 100644
--- a/ui/gfx/screen_mac.mm
+++ b/ui/gfx/screen_mac.mm
@@ -89,6 +89,15 @@ gfx::Point Screen::GetCursorScreenPoint() {
}
// static
+gfx::Monitor 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 */);
+}
+
+// static
gfx::Monitor Screen::GetPrimaryMonitor() {
// Primary monitor is defined as the monitor with the menubar,
// which is always at index 0.
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc
index 3ded451..3c868c6 100644
--- a/ui/gfx/screen_win.cc
+++ b/ui/gfx/screen_win.cc
@@ -53,7 +53,7 @@ int Screen::GetNumMonitors() {
}
// static
-gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeWindow window) {
+gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeView window) {
MONITORINFO monitor_info;
monitor_info.cbSize = sizeof(monitor_info);
GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST),