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

Unified Diff: ash/wm/workspace/workspace_window_resizer.cc

Issue 424463002: Makes a window that has been resized to maximized bounds, then maximized and then restored shrink (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Maximizes a window that has been resized to maximized bounds (added a test) Created 6 years, 5 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: ash/wm/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index c82acf2ebd344393f11d20aa5513db4b0033d975..360817475676e1ce0a8ea3fa2dd320ed05a06334 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -462,6 +462,19 @@ void WorkspaceWindowResizer::CompleteDrag() {
window_state()->Restore();
}
}
+ gfx::Rect maximized_bounds = ScreenUtil::GetMaximizedWindowBoundsInParent(
+ GetTarget());
+ if (!snapped &&
msw 2014/07/30 05:46:37 nit: a brief comment for this block would be nice.
varkha 2014/07/30 21:03:15 Done.
+ GetTarget()->bounds() == maximized_bounds &&
+ window_state()->CanMaximize()) {
+ gfx::Rect initial_bounds = ScreenUtil::ConvertRectToScreen(
+ GetTarget()->parent(), details().initial_bounds_in_parent);
+ window_state()->SetRestoreBoundsInScreen(
+ details().restore_bounds.IsEmpty() ?
+ initial_bounds :
+ details().restore_bounds);
+ window_state()->Maximize();
+ }
}
void WorkspaceWindowResizer::RevertDrag() {
« no previous file with comments | « no previous file | ash/wm/workspace/workspace_window_resizer_unittest.cc » ('j') | chrome/browser/ui/window_sizer/window_sizer.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698