summaryrefslogtreecommitdiffstats
path: root/ash
diff options
context:
space:
mode:
authorjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-24 07:15:13 +0000
committerjochen@chromium.org <jochen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-07-24 07:15:13 +0000
commit8ded3efe7d919bd27c3109146e4a0d47a266b01a (patch)
treea1deb19f28c19211d2e35d701ef8654cb82be0af /ash
parent1fc9e80dab903b1dddf3b219c9f4fb45568e090b (diff)
downloadchromium_src-8ded3efe7d919bd27c3109146e4a0d47a266b01a.zip
chromium_src-8ded3efe7d919bd27c3109146e4a0d47a266b01a.tar.gz
chromium_src-8ded3efe7d919bd27c3109146e4a0d47a266b01a.tar.bz2
Revert 213347 "Use GetDisplayNearestWindow instead of GetDislpa..."
I suspect this broke WorkspaceManagerTest on Win8 Aura http://build.chromium.org/p/chromium.win/builders/Win8%20Aura/builds/8306 > Use GetDisplayNearestWindow instead of GetDislpaymatching where appropriate > This is correct way to tell on which display > the window is on as a window doesn't overlap two > displays on ash. > > BUG=none > > Review URL: https://chromiumcodereview.appspot.com/19593008 TBR=oshima@chromium.org Review URL: https://codereview.chromium.org/19668011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@213356 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash')
-rw-r--r--ash/wm/drag_window_resizer.cc3
-rw-r--r--ash/wm/workspace/auto_window_management.cc7
-rw-r--r--ash/wm/workspace/frame_maximize_button.cc3
3 files changed, 8 insertions, 5 deletions
diff --git a/ash/wm/drag_window_resizer.cc b/ash/wm/drag_window_resizer.cc
index e8f977e..ca332b9 100644
--- a/ash/wm/drag_window_resizer.cc
+++ b/ash/wm/drag_window_resizer.cc
@@ -181,7 +181,8 @@ void DragWindowResizer::UpdateDragWindow(const gfx::Rect& bounds,
new DragWindowController(GetTarget()));
// Always show the drag phantom on the |another_root| window.
drag_window_controller_->SetDestinationDisplay(
- Shell::GetScreen()->GetDisplayNearestWindow(another_root));
+ Shell::GetScreen()->GetDisplayMatching(
+ another_root->GetBoundsInScreen()));
drag_window_controller_->Show();
} else {
// No animation.
diff --git a/ash/wm/workspace/auto_window_management.cc b/ash/wm/workspace/auto_window_management.cc
index f6356bf..067ee9e 100644
--- a/ash/wm/workspace/auto_window_management.cc
+++ b/ash/wm/workspace/auto_window_management.cc
@@ -69,8 +69,11 @@ bool GetOtherVisibleAndManageableWindow(const aura::Window* window,
}
// Get the work area for a given |window|.
-gfx::Rect GetWorkAreaForWindow(aura::Window* window) {
- return Shell::GetScreen()->GetDisplayNearestWindow(window).work_area();
+gfx::Rect GetWorkAreaForWindow(const aura::Window* window) {
+ gfx::Rect work_area = gfx::Rect(window->parent()->bounds().size());
+ work_area.Inset(Shell::GetScreen()->GetDisplayMatching(
+ work_area).GetWorkAreaInsets());
+ return work_area;
}
// Move the given |bounds| on the available |parent_width| to the
diff --git a/ash/wm/workspace/frame_maximize_button.cc b/ash/wm/workspace/frame_maximize_button.cc
index 683ffc0..f5ca589 100644
--- a/ash/wm/workspace/frame_maximize_button.cc
+++ b/ash/wm/workspace/frame_maximize_button.cc
@@ -597,8 +597,7 @@ FrameMaximizeButton::GetMaximizeBubbleFrameState() const {
return FRAME_STATE_FULL;
// For Left/right maximize we need to check the dimensions.
gfx::Rect bounds = frame_->GetWidget()->GetWindowBoundsInScreen();
- gfx::Rect screen = Shell::GetScreen()->GetDisplayNearestWindow(
- frame_->GetWidget()->GetNativeView()).work_area();
+ gfx::Rect screen = Shell::GetScreen()->GetDisplayMatching(bounds).work_area();
if (bounds.width() < (screen.width() * kMinSnapSizePercent) / 100)
return FRAME_STATE_NONE;
// We might still have a horizontally filled window at this point which we