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

Unified Diff: chrome/browser/ui/window_sizer/window_sizer_ash.cc

Issue 11343028: Revert 164652 - speculative revert - this change may have caused print dialog test failures on XP. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 2 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: chrome/browser/ui/window_sizer/window_sizer_ash.cc
===================================================================
--- chrome/browser/ui/window_sizer/window_sizer_ash.cc (revision 164764)
+++ chrome/browser/ui/window_sizer/window_sizer_ash.cc (working copy)
@@ -156,14 +156,22 @@
if (maximized)
return true;
+ gfx::Rect other_bounds_in_screen = top_window->GetBoundsInScreen();
+ bool move_right =
+ other_bounds_in_screen.CenterPoint().x() < work_area.CenterPoint().x();
+
+ // In case we have only one window, we move the other window fully to the
+ // "other side" - making room for this new window.
+ if (count == 1) {
+ gfx::Display display = ash::Shell::GetScreen()->GetDisplayMatching(
+ top_window->GetRootWindow()->GetBoundsInScreen());
+ if (MoveRect(work_area, other_bounds_in_screen, !move_right))
+ top_window->SetBoundsInScreen(other_bounds_in_screen, display);
+ }
// Use the size of the other window, and mirror the location to the
// opposite side. Then make sure that it is inside our work area
// (if possible).
- *bounds_in_screen = top_window->GetBoundsInScreen();
-
- bool move_right =
- bounds_in_screen->CenterPoint().x() < work_area.CenterPoint().x();
-
+ *bounds_in_screen = other_bounds_in_screen;
MoveRect(work_area, *bounds_in_screen, move_right);
if (bounds_in_screen->bottom() > work_area.bottom())
bounds_in_screen->set_y(std::max(work_area.y(),

Powered by Google App Engine
This is Rietveld 408576698