diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 20:50:36 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-01-22 20:50:36 +0000 |
commit | 2a2caa0c24fb2adb2a889d24c85f120f55efac52 (patch) | |
tree | 40f6803189fb0bbdb7af69c114377b8ae448d99b /ui/gfx | |
parent | f47621b16b748a2cb828e2f28b39f717c48ab65d (diff) | |
download | chromium_src-2a2caa0c24fb2adb2a889d24c85f120f55efac52.zip chromium_src-2a2caa0c24fb2adb2a889d24c85f120f55efac52.tar.gz chromium_src-2a2caa0c24fb2adb2a889d24c85f120f55efac52.tar.bz2 |
Finally rip the global StackingClient bandaid off.
- Removes the aura::client::SetStackingClient(StackingClient*) interface.
- Moves the ash StackingController from a singleton owned by ash::Shell to one StackingController per RootWindow owned by the ash::RootWindowController. (Also removes a spurious delegate method, where every implementation creates the same object, including tests.)
- Removes the global DesktopStackingClient and related interfaces.
- Fix the ChromeViewsDelegate so that it still sets context in chromeos builds.
- Rename content::ShellStackingClientAsh to content::MinimalAsh to reflect what it really does.
In addition, the following fix ups apply:
- Previously, WebContentsViewAura asserted that it needed a context window. Now if no context window is provided, it isn't added to an aura hierarchy. There are times when that context doesn't exist: various chromeos dialogs that directly invoke WebView and toplevel extension/app windows that are created from background pages that don't have contexts.
- Because of that, added a few of NULL checking to RenderWidgetHostViewAura. (Other methods NULL checked Window::GetRootWindow(), but there were a few that didn't and relied on the old NULL means lookup in the StackingClient behaviour.)
BUG=161882
Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=177182
Review URL: https://codereview.chromium.org/11829040
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@178083 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/gfx')
-rw-r--r-- | ui/gfx/screen_win.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/ui/gfx/screen_win.cc b/ui/gfx/screen_win.cc index 9b33c6b..80614a4 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) { + // 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), |