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

Unified Diff: ui/gfx/screen_win.cc

Issue 11829040: Fix the content_browsertests everywhere maybe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: And fix the final ExtensionApiTest.AlertBasic case. Created 7 years, 11 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_win.cc
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc
index 9b33c6b20024f5154671e19c4e3202ef20917952..80614a4bf34a892a2a4fc506fa7a83cbafd26fff 100644
--- a/ui/gfx/screen_win.cc
+++ b/ui/gfx/screen_win.cc
@@ -57,6 +57,13 @@ int ScreenWin::GetNumDisplays() {
gfx::Display ScreenWin::GetDisplayNearestWindow(gfx::NativeView window) const {
HWND window_hwnd = GetHWNDFromNativeView(window);
+ if (!window_hwnd) {
Elliot Glaysher 2013/01/18 20:31:38 I'd like to fix this at a higher level, but there
+ // When |window| isn't rooted to a display, we should just return the
+ // default display so we get some correct display information like the
+ // scaling factor.
+ return GetPrimaryDisplay();
+ }
+
MONITORINFO monitor_info;
monitor_info.cbSize = sizeof(monitor_info);
GetMonitorInfo(MonitorFromWindow(window_hwnd, MONITOR_DEFAULTTONEAREST),

Powered by Google App Engine
This is Rietveld 408576698