| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #ifndef ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ | 5 #ifndef ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ |
| 6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ | 6 #define ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include "ash/ash_export.h" | 10 #include "ash/ash_export.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 // orientation's layer will be rotated in to the |new_orientation| through | 105 // orientation's layer will be rotated in to the |new_orientation| through |
| 106 // |rotation_degrees| arc. | 106 // |rotation_degrees| arc. |
| 107 void AnimateRotation(std::unique_ptr<ScreenRotationRequest> rotation_request); | 107 void AnimateRotation(std::unique_ptr<ScreenRotationRequest> rotation_request); |
| 108 | 108 |
| 109 void set_disable_animation_timers_for_test(bool disable_timers); | 109 void set_disable_animation_timers_for_test(bool disable_timers); |
| 110 | 110 |
| 111 void StopAnimating(); | 111 void StopAnimating(); |
| 112 | 112 |
| 113 // The id of the display to rotate. | 113 // The id of the display to rotate. |
| 114 int64_t display_id_; | 114 int64_t display_id_; |
| 115 bool is_rotating_; | 115 |
| 116 // For current slow rotation animation, there are two states |ROTATING| and |
| 117 // |IDLE|. For the smooth rotation animation, we need to send copy request |
| 118 // and get copy result before animating. |
| 119 enum ScreenRotationState { |
| 120 COPY_REQUESTED, |
| 121 ROTATING, |
| 122 IDLE, |
| 123 }; |
| 124 ScreenRotationState screen_rotation_state_; |
| 125 |
| 116 std::unique_ptr<ui::AnimationMetricsReporter> metrics_reporter_; | 126 std::unique_ptr<ui::AnimationMetricsReporter> metrics_reporter_; |
| 117 // Only set in unittest to disable animation timers. | 127 // Only set in unittest to disable animation timers. |
| 118 bool disable_animation_timers_for_test_; | 128 bool disable_animation_timers_for_test_; |
| 119 base::ObserverList<ScreenRotationAnimatorObserver> | 129 base::ObserverList<ScreenRotationAnimatorObserver> |
| 120 screen_rotation_animator_observers_; | 130 screen_rotation_animator_observers_; |
| 121 std::unique_ptr<ui::LayerTreeOwner> old_layer_tree_owner_; | 131 std::unique_ptr<ui::LayerTreeOwner> old_layer_tree_owner_; |
| 122 std::unique_ptr<ScreenRotationRequest> last_pending_request_; | 132 std::unique_ptr<ScreenRotationRequest> last_pending_request_; |
| 123 base::WeakPtrFactory<ScreenRotationAnimator> weak_factory_; | 133 base::WeakPtrFactory<ScreenRotationAnimator> weak_factory_; |
| 124 | 134 |
| 125 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator); | 135 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator); |
| 126 }; | 136 }; |
| 127 | 137 |
| 128 } // namespace ash | 138 } // namespace ash |
| 129 | 139 |
| 130 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ | 140 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ |
| OLD | NEW |