Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 // Pass NULL as the WindowResizerOwner as only this class knows how to |
| 102 // handle drags with two finger gestures. | |
| 103 window_resizer_ = CreateWindowResizer(/* owner */ NULL, target, | |
|
stevenjb
2013/03/13 19:31:39
NULL /* owner */
| |
| 102 event.details().bounding_box().CenterPoint(), HTCAPTION); | 104 event.details().bounding_box().CenterPoint(), HTCAPTION); |
| 103 return true; | 105 return true; |
| 104 } | 106 } |
| 105 } | 107 } |
| 106 | 108 |
| 107 return false; | 109 return false; |
| 108 } | 110 } |
| 109 | 111 |
| 110 if (!window_resizer_.get()) { | 112 if (!window_resizer_.get()) { |
| 111 // Consume all two-finger gestures on a normal window. | 113 // Consume all two-finger gestures on a normal window. |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 186 bool visible) { | 188 bool visible) { |
| 187 Reset(); | 189 Reset(); |
| 188 } | 190 } |
| 189 | 191 |
| 190 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) { | 192 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) { |
| 191 Reset(); | 193 Reset(); |
| 192 } | 194 } |
| 193 | 195 |
| 194 } // namespace internal | 196 } // namespace internal |
| 195 } // namespace ash | 197 } // namespace ash |
| OLD | NEW |