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 "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/gfx/display.h" | 10 #include "ui/gfx/display.h" |
11 | 11 |
12 namespace ash { | 12 namespace ash { |
13 | 13 |
14 // Utility to perform a screen rotation with an animation. | 14 // Utility to perform a screen rotation with an animation. |
15 class ASH_EXPORT ScreenRotationAnimator { | 15 class ASH_EXPORT ScreenRotationAnimator { |
16 public: | 16 public: |
17 explicit ScreenRotationAnimator(int64 display_id); | 17 explicit ScreenRotationAnimator(int64 display_id); |
18 ~ScreenRotationAnimator(); | 18 ~ScreenRotationAnimator(); |
19 | 19 |
20 // Rotates |display_| to the |new_rotation| orientation. | 20 // Rotates |display_| to the |new_rotation| orientation, for the given |
21 void Rotate(gfx::Display::Rotation new_rotation); | 21 // |source|. The rotation will also become active. |
| 22 void Rotate(gfx::Display::Rotation new_rotation, |
| 23 gfx::Display::RotationSource source); |
22 | 24 |
23 private: | 25 private: |
24 // The id of the display to rotate. | 26 // The id of the display to rotate. |
25 int64 display_id_; | 27 int64 display_id_; |
26 | 28 |
27 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator); | 29 DISALLOW_COPY_AND_ASSIGN(ScreenRotationAnimator); |
28 }; | 30 }; |
29 | 31 |
30 } // namespace ash | 32 } // namespace ash |
31 | 33 |
32 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ | 34 #endif // ASH_ROTATOR_SCREEN_ROTATION_ANIMATOR_H_ |
OLD | NEW |