OLD | NEW |
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 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); | 153 &other_bounds_rect, MONITOR_DEFAULTTONEAREST)); |
154 return GetDisplay(monitor_info); | 154 return GetDisplay(monitor_info); |
155 } | 155 } |
156 | 156 |
157 gfx::Display ScreenWin::GetPrimaryDisplay() const { | 157 gfx::Display ScreenWin::GetPrimaryDisplay() const { |
158 MONITORINFOEX mi = GetMonitorInfoForMonitor( | 158 MONITORINFOEX mi = GetMonitorInfoForMonitor( |
159 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); | 159 MonitorFromWindow(NULL, MONITOR_DEFAULTTOPRIMARY)); |
160 gfx::Display display = GetDisplay(mi); | 160 gfx::Display display = GetDisplay(mi); |
161 // TODO(kevers|girard): Test if these checks can be reintroduced for high-DIP | 161 // TODO(kevers|girard): Test if these checks can be reintroduced for high-DIP |
162 // once more of the app is DIP-aware. | 162 // once more of the app is DIP-aware. |
163 if (!(GetDPIScale() > 1.0 || IsHighDPIEnabled())) { | 163 if (GetDPIScale() == 1.0) { |
164 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); | 164 DCHECK_EQ(GetSystemMetrics(SM_CXSCREEN), display.size().width()); |
165 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); | 165 DCHECK_EQ(GetSystemMetrics(SM_CYSCREEN), display.size().height()); |
166 } | 166 } |
167 return display; | 167 return display; |
168 } | 168 } |
169 | 169 |
170 void ScreenWin::AddObserver(DisplayObserver* observer) { | 170 void ScreenWin::AddObserver(DisplayObserver* observer) { |
171 change_notifier_.AddObserver(observer); | 171 change_notifier_.AddObserver(observer); |
172 } | 172 } |
173 | 173 |
(...skipping 18 matching lines...) Expand all Loading... |
192 NOTREACHED(); | 192 NOTREACHED(); |
193 return NULL; | 193 return NULL; |
194 } | 194 } |
195 | 195 |
196 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { | 196 NativeWindow ScreenWin::GetNativeWindowFromHWND(HWND hwnd) const { |
197 NOTREACHED(); | 197 NOTREACHED(); |
198 return NULL; | 198 return NULL; |
199 } | 199 } |
200 | 200 |
201 } // namespace gfx | 201 } // namespace gfx |
OLD | NEW |