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

Side by Side Diff: ui/gfx/screen_win.cc

Issue 10537067: mac: Basic HighDPI implementation for web contents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: done 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 unified diff | Download patch | Annotate | Revision Log
« ui/gfx/screen_mac.mm ('K') | « ui/gfx/screen_mac.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #include "ui/gfx/screen.h" 5 #include "ui/gfx/screen.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "ui/gfx/monitor.h" 10 #include "ui/gfx/monitor.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 POINT location; 46 POINT location;
47 return GetCursorPos(&location) ? WindowFromPoint(location) : NULL; 47 return GetCursorPos(&location) ? WindowFromPoint(location) : NULL;
48 } 48 }
49 49
50 // static 50 // static
51 int Screen::GetNumMonitors() { 51 int Screen::GetNumMonitors() {
52 return GetSystemMetrics(SM_CMONITORS); 52 return GetSystemMetrics(SM_CMONITORS);
53 } 53 }
54 54
55 // static 55 // static
56 gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeWindow window) { 56 gfx::Monitor Screen::GetMonitorNearestWindow(gfx::NativeView window) {
57 MONITORINFO monitor_info; 57 MONITORINFO monitor_info;
58 monitor_info.cbSize = sizeof(monitor_info); 58 monitor_info.cbSize = sizeof(monitor_info);
59 GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST), 59 GetMonitorInfo(MonitorFromWindow(window, MONITOR_DEFAULTTONEAREST),
60 &monitor_info); 60 &monitor_info);
61 return GetMonitor(monitor_info); 61 return GetMonitor(monitor_info);
62 } 62 }
63 63
64 // static 64 // static
65 gfx::Monitor Screen::GetMonitorNearestPoint(const gfx::Point& point) { 65 gfx::Monitor Screen::GetMonitorNearestPoint(const gfx::Point& point) {
66 POINT initial_loc = { point.x(), point.y() }; 66 POINT initial_loc = { point.x(), point.y() };
(...skipping 17 matching lines...) Expand all
84 84
85 // static 85 // static
86 gfx::Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) { 86 gfx::Monitor Screen::GetMonitorMatching(const gfx::Rect& match_rect) {
87 RECT other_bounds_rect = match_rect.ToRECT(); 87 RECT other_bounds_rect = match_rect.ToRECT();
88 MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect( 88 MONITORINFO monitor_info = GetMonitorInfoForMonitor(MonitorFromRect(
89 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); 89 &other_bounds_rect, MONITOR_DEFAULTTONEAREST));
90 return GetMonitor(monitor_info); 90 return GetMonitor(monitor_info);
91 } 91 }
92 92
93 } // namespace gfx 93 } // namespace gfx
OLDNEW
« ui/gfx/screen_mac.mm ('K') | « ui/gfx/screen_mac.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698