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

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

Issue 669213004: remove IsInHighDPIMode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 1 month 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
« no previous file with comments | « no previous file | ui/gfx/win/dpi.h » ('j') | 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_win.h" 5 #include "ui/gfx/screen_win.h"
6 6
7 #include <windows.h> 7 #include <windows.h>
8 8
9 #include "base/hash.h" 9 #include "base/hash.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 86
87 ScreenWin::ScreenWin() 87 ScreenWin::ScreenWin()
88 : displays_(GetDisplays()) { 88 : displays_(GetDisplays()) {
89 SingletonHwnd::GetInstance()->AddObserver(this); 89 SingletonHwnd::GetInstance()->AddObserver(this);
90 } 90 }
91 91
92 ScreenWin::~ScreenWin() { 92 ScreenWin::~ScreenWin() {
93 SingletonHwnd::GetInstance()->RemoveObserver(this); 93 SingletonHwnd::GetInstance()->RemoveObserver(this);
94 } 94 }
95 95
96 bool ScreenWin::IsDIPEnabled() { 96 bool ScreenWin::IsDIPEnabled() {
scottmg 2014/10/23 02:42:06 I think IsDIPEnabled could be deleted, it seems to
97 return IsInHighDPIMode(); 97 return GetDPIScale() > 1.0;
98 } 98 }
99 99
100 gfx::Point ScreenWin::GetCursorScreenPoint() { 100 gfx::Point ScreenWin::GetCursorScreenPoint() {
101 POINT pt; 101 POINT pt;
102 GetCursorPos(&pt); 102 GetCursorPos(&pt);
103 gfx::Point cursor_pos_pixels(pt); 103 gfx::Point cursor_pos_pixels(pt);
104 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels); 104 return gfx::win::ScreenToDIPPoint(cursor_pos_pixels);
105 } 105 }
106 106
107 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() { 107 gfx::NativeWindow ScreenWin::GetWindowUnderCursor() {
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); 157 &other_bounds_rect, MONITOR_DEFAULTTONEAREST));
158 return GetDisplay(monitor_info); 158 return GetDisplay(monitor_info);
159 } 159 }
160 160
161 gfx::Display ScreenWin::GetPrimaryDisplay() const { 161 gfx::Display ScreenWin::GetPrimaryDisplay() const {
162 MONITORINFOEX mi = GetMonitorInfoForMonitor( 162 MONITORINFOEX mi = GetMonitorInfoForMonitor(
163 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); 163 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY));
164 gfx::Display display = GetDisplay(mi); 164 gfx::Display display = GetDisplay(mi);
165 // TODO(kevers|girard): Test if these checks can be reintroduced for high-DIP 165 // TODO(kevers|girard): Test if these checks can be reintroduced for high-DIP
166 // once more of the app is DIP-aware. 166 // once more of the app is DIP-aware.
167 if (!(IsInHighDPIMode() || IsHighDPIEnabled())) { 167 if (!(GetDPIScale() > 1.0 || IsHighDPIEnabled())) {
168 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); 168 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width());
169 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); 169 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height());
170 } 170 }
171 return display; 171 return display;
172 } 172 }
173 173
174 void ScreenWin::AddObserver(DisplayObserver* observer) { 174 void ScreenWin::AddObserver(DisplayObserver* observer) {
175 change_notifier_.AddObserver(observer); 175 change_notifier_.AddObserver(observer);
176 } 176 }
177 177
(...skipping 18 matching lines...) Expand all
196 NOTREACHED(); 196 NOTREACHED();
197 return NULL; 197 return NULL;
198 } 198 }
199 199
200 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { 200 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const {
201 NOTREACHED(); 201 NOTREACHED();
202 return NULL; 202 return NULL;
203 } 203 }
204 204
205 } // namespace gfx 205 } // namespace gfx
OLDNEW
« no previous file with comments | « no previous file | ui/gfx/win/dpi.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698