OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "athena/wm/title_drag_controller.h" | 5 #include "athena/wm/title_drag_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "ui/aura/window.h" | 8 #include "ui/aura/window.h" |
9 #include "ui/aura/window_delegate.h" | 9 #include "ui/aura/window_delegate.h" |
10 #include "ui/base/hit_test.h" | 10 #include "ui/base/hit_test.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 window, | 52 window, |
53 complete))); | 53 complete))); |
54 gfx::Transform transform; | 54 gfx::Transform transform; |
55 transform.Translate(0, complete ? window->bounds().height() : 0); | 55 transform.Translate(0, complete ? window->bounds().height() : 0); |
56 window->SetTransform(transform); | 56 window->SetTransform(transform); |
57 } | 57 } |
58 | 58 |
59 void TitleDragController::OnTransitionEnd(aura::Window* window, bool complete) { | 59 void TitleDragController::OnTransitionEnd(aura::Window* window, bool complete) { |
60 weak_ptr_.InvalidateWeakPtrs(); | 60 weak_ptr_.InvalidateWeakPtrs(); |
61 if (!tracker_.Contains(window)) | 61 if (!tracker_.Contains(window)) |
62 window = NULL; | 62 window = nullptr; |
63 shadow_.reset(); | 63 shadow_.reset(); |
64 if (window) { | 64 if (window) { |
65 window->SetTransform(gfx::Transform()); | 65 window->SetTransform(gfx::Transform()); |
66 tracker_.Remove(window); | 66 tracker_.Remove(window); |
67 } | 67 } |
68 if (complete && window && wm::IsActiveWindow(window)) | 68 if (complete && window && wm::IsActiveWindow(window)) |
69 delegate_->OnTitleDragCompleted(window); | 69 delegate_->OnTitleDragCompleted(window); |
70 else | 70 else |
71 delegate_->OnTitleDragCanceled(window); | 71 delegate_->OnTitleDragCanceled(window); |
72 } | 72 } |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 EndTransition( | 135 EndTransition( |
136 window, | 136 window, |
137 swipe_downwards && | 137 swipe_downwards && |
138 (distance.y() >= kMinDragDistanceForSwitch || | 138 (distance.y() >= kMinDragDistanceForSwitch || |
139 gesture->details().velocity_y() >= kMinDragVelocityForSwitch)); | 139 gesture->details().velocity_y() >= kMinDragVelocityForSwitch)); |
140 gesture->SetHandled(); | 140 gesture->SetHandled(); |
141 } | 141 } |
142 } | 142 } |
143 | 143 |
144 } // namespace athena | 144 } // namespace athena |
OLD | NEW |