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

Side by Side Diff: ash/wm/gestures/two_finger_drag_handler.cc

Issue 15008002: Make touch-resizing windows to screen edge possible (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adjust unit tests with final behavior 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ash/wm/drag_window_resizer_unittest.cc ('k') | ash/wm/panels/panel_window_resizer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/wm/gestures/two_finger_drag_handler.h" 5 #include "ash/wm/gestures/two_finger_drag_handler.h"
6 6
7 #include "ash/wm/window_resizer.h" 7 #include "ash/wm/window_resizer.h"
8 #include "ash/wm/window_util.h" 8 #include "ash/wm/window_util.h"
9 #include "ash/wm/workspace/snap_sizer.h" 9 #include "ash/wm/workspace/snap_sizer.h"
10 #include "ui/aura/client/window_types.h" 10 #include "ui/aura/client/window_types.h"
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 return false; 91 return false;
92 } 92 }
93 93
94 if (event.type() == ui::ET_GESTURE_BEGIN && 94 if (event.type() == ui::ET_GESTURE_BEGIN &&
95 event.details().touch_points() == 2) { 95 event.details().touch_points() == 2) {
96 if (!window_resizer_.get() && wm::IsWindowNormal(target) && 96 if (!window_resizer_.get() && wm::IsWindowNormal(target) &&
97 target->type() == aura::client::WINDOW_TYPE_NORMAL) { 97 target->type() == aura::client::WINDOW_TYPE_NORMAL) {
98 if (WindowComponentsAllowMoving(first_finger_hittest_, 98 if (WindowComponentsAllowMoving(first_finger_hittest_,
99 target->delegate()->GetNonClientComponent(event.location()))) { 99 target->delegate()->GetNonClientComponent(event.location()))) {
100 target->AddObserver(this); 100 target->AddObserver(this);
101 window_resizer_ = CreateWindowResizer(target, 101 window_resizer_ = CreateWindowResizer(
102 event.details().bounding_box().CenterPoint(), HTCAPTION); 102 target,
103 event.details().bounding_box().CenterPoint(),
104 HTCAPTION,
105 aura::client::WINDOW_MOVE_SOURCE_TOUCH);
103 return true; 106 return true;
104 } 107 }
105 } 108 }
106 109
107 return false; 110 return false;
108 } 111 }
109 112
110 if (!window_resizer_) { 113 if (!window_resizer_) {
111 // Consume all two-finger gestures on a normal window. 114 // Consume all two-finger gestures on a normal window.
112 return event.details().touch_points() == 2 && 115 return event.details().touch_points() == 2 &&
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 bool visible) { 189 bool visible) {
187 Reset(); 190 Reset();
188 } 191 }
189 192
190 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) { 193 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) {
191 Reset(); 194 Reset();
192 } 195 }
193 196
194 } // namespace internal 197 } // namespace internal
195 } // namespace ash 198 } // namespace ash
OLDNEW
« no previous file with comments | « ash/wm/drag_window_resizer_unittest.cc ('k') | ash/wm/panels/panel_window_resizer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698