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

Unified Diff: ash/wm/default_state.cc

Issue 1156893008: Fixes tab dragging out of a window with maximzied bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixes tab dragging out of a window with maximzied bounds (test) Created 5 years, 6 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/default_state.cc
diff --git a/ash/wm/default_state.cc b/ash/wm/default_state.cc
index 61a3dc6b09120e7fcb0529e2ee51659898c6b010..7082b4170c8bc33bbb459512967ac98afff618eb 100644
--- a/ash/wm/default_state.cc
+++ b/ash/wm/default_state.cc
@@ -31,6 +31,11 @@ namespace {
// must be visible when the window is added to the workspace.
const float kMinimumPercentOnScreenArea = 0.3f;
+// When a window that has restore bounds at least as large as a work area is
+// unmaximized inset the bounds slightly so that they are not exactly same. This
msw 2015/06/05 17:20:51 nit: comma here: "unmaximized," and "exactly the s
varkha 2015/06/05 17:55:28 Done.
+// makes it easier to resize the window.
+const int kMaximizedWindowInset = 10; // Pixels.
+
bool IsMinimizedWindowState(const WindowStateType state_type) {
return state_type == WINDOW_STATE_TYPE_MINIMIZED ||
state_type == WINDOW_STATE_TYPE_DOCKED_MINIMIZED;
@@ -646,7 +651,8 @@ void DefaultState::UpdateBoundsFromState(WindowState* window_state,
// Inset the bounds slightly so that they are not exactly same as
// the work area bounds and it is easier to resize the window.
bounds_in_parent = work_area_in_parent;
- bounds_in_parent.Inset(10, 10, 10, 10);
+ bounds_in_parent.Inset(kMaximizedWindowInset, kMaximizedWindowInset,
+ kMaximizedWindowInset, kMaximizedWindowInset);
}
} else {
bounds_in_parent = window->bounds();

Powered by Google App Engine
This is Rietveld 408576698