| 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" | |
| 10 #include "ui/aura/client/window_types.h" | 9 #include "ui/aura/client/window_types.h" |
| 11 #include "ui/aura/window.h" | 10 #include "ui/aura/window.h" |
| 12 #include "ui/aura/window_delegate.h" | 11 #include "ui/aura/window_delegate.h" |
| 13 #include "ui/base/events/event.h" | 12 #include "ui/base/events/event.h" |
| 14 #include "ui/base/events/event_constants.h" | 13 #include "ui/base/events/event_constants.h" |
| 15 #include "ui/base/hit_test.h" | 14 #include "ui/base/hit_test.h" |
| 16 #include "ui/compositor/layer.h" | 15 #include "ui/compositor/layer.h" |
| 17 #include "ui/compositor/scoped_layer_animation_settings.h" | 16 #include "ui/compositor/scoped_layer_animation_settings.h" |
| 18 | 17 |
| 19 namespace { | 18 namespace { |
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 if (wm::CanMaximizeWindow(target)) | 139 if (wm::CanMaximizeWindow(target)) |
| 141 wm::MaximizeWindow(target); | 140 wm::MaximizeWindow(target); |
| 142 } else if (event.details().swipe_down() && | 141 } else if (event.details().swipe_down() && |
| 143 wm::CanMinimizeWindow(target)) { | 142 wm::CanMinimizeWindow(target)) { |
| 144 wm::MinimizeWindow(target); | 143 wm::MinimizeWindow(target); |
| 145 } else if (wm::CanSnapWindow(target)) { | 144 } else if (wm::CanSnapWindow(target)) { |
| 146 ui::ScopedLayerAnimationSettings scoped_setter( | 145 ui::ScopedLayerAnimationSettings scoped_setter( |
| 147 target->layer()->GetAnimator()); | 146 target->layer()->GetAnimator()); |
| 148 scoped_setter.SetPreemptionStrategy( | 147 scoped_setter.SetPreemptionStrategy( |
| 149 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 148 ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
| 150 internal::SnapSizer::SnapWindow(target, | 149 wm::SnapWindowToEdge(target, |
| 151 event.details().swipe_left() ? internal::SnapSizer::LEFT_EDGE : | 150 event.details().swipe_left() ? wm::SNAP_LEFT_EDGE : |
| 152 internal::SnapSizer::RIGHT_EDGE); | 151 wm::SNAP_RIGHT_EDGE); |
| 153 } | 152 } |
| 154 return true; | 153 return true; |
| 155 } | 154 } |
| 156 | 155 |
| 157 case ui::ET_GESTURE_PINCH_UPDATE: | 156 case ui::ET_GESTURE_PINCH_UPDATE: |
| 158 case ui::ET_GESTURE_SCROLL_UPDATE: | 157 case ui::ET_GESTURE_SCROLL_UPDATE: |
| 159 window_resizer_->Drag(event.details().bounding_box().CenterPoint(), | 158 window_resizer_->Drag(event.details().bounding_box().CenterPoint(), |
| 160 event.flags()); | 159 event.flags()); |
| 161 return true; | 160 return true; |
| 162 | 161 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 189 bool visible) { | 188 bool visible) { |
| 190 Reset(); | 189 Reset(); |
| 191 } | 190 } |
| 192 | 191 |
| 193 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) { | 192 void TwoFingerDragHandler::OnWindowDestroying(aura::Window* window) { |
| 194 Reset(); | 193 Reset(); |
| 195 } | 194 } |
| 196 | 195 |
| 197 } // namespace internal | 196 } // namespace internal |
| 198 } // namespace ash | 197 } // namespace ash |
| OLD | NEW |