| Index: views/animation/screen_rotation.h
|
| diff --git a/views/animation/screen_rotation.h b/views/animation/screen_rotation.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..520eb58408e79eb65dfd23bb1789dc2c20cccedb
|
| --- /dev/null
|
| +++ b/views/animation/screen_rotation.h
|
| @@ -0,0 +1,52 @@
|
| +// Copyright (c) 2011 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef VIEWS_ANIMATION_SCREEN_ROTATION_H_
|
| +#define VIEWS_ANIMATION_SCREEN_ROTATION_H_
|
| +#pragma once
|
| +
|
| +#include "base/basictypes.h"
|
| +#include "base/memory/scoped_ptr.h"
|
| +#include "content/browser/sensors/provider.h"
|
| +#include "content/common/sensors.h"
|
| +#include "ui/base/animation/animation_delegate.h"
|
| +#include "ui/gfx/point.h"
|
| +#include "ui/gfx/size.h"
|
| +
|
| +namespace ui {
|
| +class SlideAnimation;
|
| +class InterpolatedTransform;
|
| +}
|
| +
|
| +namespace views {
|
| +class View;
|
| +
|
| +class ScreenRotation : public ui::AnimationDelegate {
|
| + public:
|
| + static void Perform(views::View* root, float old_degrees, float new_degrees);
|
| +
|
| + private:
|
| + ScreenRotation(views::View* root, float old_degrees, float new_degrees);
|
| +
|
| + // Implementation of ui::AnimationDelegate
|
| + virtual void AnimationEnded(const ui::Animation* anim) OVERRIDE;
|
| + virtual void AnimationProgressed(const ui::Animation* anim) OVERRIDE;
|
| +
|
| + int NormalizeAngle(int degrees);
|
| + void Start();
|
| +
|
| + views::View* root_;
|
| + scoped_ptr<ui::SlideAnimation> animation_;
|
| + scoped_ptr<ui::InterpolatedTransform> interpolated_transform_;
|
| + float old_degrees_;
|
| + float new_degrees_;
|
| + gfx::Size new_size_;
|
| + gfx::Point new_origin_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(ScreenRotation);
|
| +};
|
| +
|
| +} // namespace views
|
| +
|
| +#endif // VIEWS_ANIMATION_SCREEN_ROTATION_H_
|
|
|