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

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

Issue 153893005: Makes it easier to snap or dock windows near the edges when using touch (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 10 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
« no previous file with comments | « ash/wm/workspace/snap_sizer.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1f82c48ca06657d6cd6fa595dd3a4227ab7f0378..1b353eba66d9dcb73dc9b3cbf95ced75b934e6f5 100644
--- a/ash/wm/workspace/workspace_window_resizer.cc
+++ b/ash/wm/workspace/workspace_window_resizer.cc
@@ -109,10 +109,6 @@ namespace internal {
namespace {
-// Snapping distance used instead of WorkspaceWindowResizer::kScreenEdgeInset
-// when resizing a window using touchscreen.
-const int kScreenEdgeInsetForTouchResize = 32;
-
// Returns true if the window should stick to the edge.
bool ShouldStickToEdge(int distance_from_edge, int sticky_size) {
if (CommandLine::ForCurrentProcess()->HasSwitch(
@@ -368,7 +364,7 @@ void WorkspaceWindowResizer::Drag(const gfx::Point& location_in_parent,
sticky_size = kStickyDistancePixels;
} else if ((details().bounds_change & kBoundsChange_Resizes) &&
details().source == aura::client::WINDOW_MOVE_SOURCE_TOUCH) {
- sticky_size = kScreenEdgeInsetForTouchResize;
+ sticky_size = SnapSizer::kScreenEdgeInsetForTouchDrag;
} else {
sticky_size = kScreenEdgeInset;
}
@@ -919,10 +915,10 @@ void WorkspaceWindowResizer::UpdateSnapPhantomWindow(const gfx::Point& location,
SnapSizer::Edge edge = (snap_type_ == SNAP_LEFT) ?
SnapSizer::LEFT_EDGE : SnapSizer::RIGHT_EDGE;
if (!snap_sizer_) {
- snap_sizer_.reset(new SnapSizer(window_state(),
- location,
- edge,
- internal::SnapSizer::OTHER_INPUT));
+ SnapSizer::InputType input =
+ details().source == aura::client::WINDOW_MOVE_SOURCE_TOUCH ?
+ SnapSizer::TOUCH_DRAG_INPUT : SnapSizer::OTHER_INPUT;
+ snap_sizer_.reset(new SnapSizer(window_state(), location, edge, input));
} else {
snap_sizer_->Update(location);
}
@@ -1001,10 +997,10 @@ SnapType WorkspaceWindowResizer::GetSnapType(
gfx::Rect display_bounds(ScreenUtil::GetDisplayBoundsInParent(GetTarget()));
int inset_left = 0;
if (area.x() == display_bounds.x())
- inset_left = kScreenEdgeInsetForTouchResize;
+ inset_left = SnapSizer::kScreenEdgeInsetForTouchDrag;
int inset_right = 0;
if (area.right() == display_bounds.right())
- inset_right = kScreenEdgeInsetForTouchResize;
+ inset_right = SnapSizer::kScreenEdgeInsetForTouchDrag;
area.Inset(inset_left, 0, inset_right, 0);
}
if (location.x() <= area.x())
« no previous file with comments | « ash/wm/workspace/snap_sizer.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698