Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef VIEWS_ANIMATION_SCREEN_ROTATION_H_ | |
| 6 #define VIEWS_ANIMATION_SCREEN_ROTATION_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "content/browser/sensors/provider.h" | |
| 12 #include "content/common/sensors.h" | |
|
tfarina
2011/07/22 14:38:17
I don't think views/ can depend on content/. Also
| |
| 13 #include "ui/base/animation/animation_delegate.h" | |
| 14 #include "ui/gfx/point.h" | |
| 15 #include "ui/gfx/size.h" | |
| 16 | |
| 17 namespace ui { | |
| 18 class SlideAnimation; | |
| 19 class InterpolatedTransform; | |
| 20 } | |
| 21 | |
| 22 namespace views { | |
| 23 class View; | |
| 24 | |
| 25 class ScreenRotation : public ui::AnimationDelegate { | |
| 26 public: | |
| 27 static void Perform(View* root, float old_degrees, float new_degrees); | |
| 28 | |
| 29 private: | |
| 30 ScreenRotation(View* root, float old_degrees, float new_degrees); | |
| 31 | |
| 32 // Implementation of ui::AnimationDelegate | |
| 33 virtual void AnimationEnded(const ui::Animation* anim) OVERRIDE; | |
| 34 virtual void AnimationProgressed(const ui::Animation* anim) OVERRIDE; | |
| 35 | |
| 36 int NormalizeAngle(int degrees); | |
| 37 void Start(); | |
| 38 | |
| 39 View* root_; | |
| 40 scoped_ptr<ui::SlideAnimation> animation_; | |
| 41 scoped_ptr<ui::InterpolatedTransform> interpolated_transform_; | |
| 42 float old_degrees_; | |
| 43 float new_degrees_; | |
| 44 gfx::Size new_size_; | |
| 45 gfx::Point new_origin_; | |
| 46 | |
| 47 DISALLOW_COPY_AND_ASSIGN(ScreenRotation); | |
| 48 }; | |
| 49 | |
| 50 } // namespace views | |
| 51 | |
| 52 #endif // VIEWS_ANIMATION_SCREEN_ROTATION_H_ | |
| OLD | NEW |