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

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

Issue 15008002: Make touch-resizing windows to screen edge possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added test coverage Created 7 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/workspace/workspace_window_resizer.cc
diff --git a/ash/wm/workspace/workspace_window_resizer.cc b/ash/wm/workspace/workspace_window_resizer.cc
index 25430933827c63762fb0e9b7dcc1cc1d348f5370..279c1ec631f0f83dec9008f7ba465c9c9b358dc8 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -80,6 +80,10 @@ namespace {
// to move or resize beyond that edge.
const int kStickyDistancePixels = 64;
+// Snapping distance used instead of WorkspaceWindowResizer::kScreenEdgeInset
+// when resizing a window using touchscreen.
+const int kScreenEdgeInsetForTouchResize = 16;
+
// Returns true if the window should stick to the edge.
bool ShouldStickToEdge(int distance_from_edge, int sticky_size) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -327,7 +331,10 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
switches::kAshEnableStickyEdges)) {
sticky_size = kStickyDistancePixels;
} else {
- sticky_size = kScreenEdgeInset;
+ if ((details_.bounds_change & kBoundsChange_Resizes) && details_.is_touch)
+ sticky_size = kScreenEdgeInsetForTouchResize;
+ else
+ sticky_size = kScreenEdgeInset;
}
// |bounds| is in |window()->parent()|'s coordinates.
gfx::Rect bounds = CalculateBoundsForDrag(details_, location_in_parent);

Powered by Google App Engine
This is Rietveld 408576698