Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(125)

Unified Diff: views/animation/screen_rotation.h

Issue 7273073: Animated Rotation (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Removed unnecessary include Created 9 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..0a9b73ee951b5611752929470f4d1e713e59a4ca
--- /dev/null
+++ b/views/animation/screen_rotation.h
@@ -0,0 +1,51 @@
+// 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 "ui/gfx/compositor/layer_animation.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::LayerAnimation {
sky 2011/08/17 16:39:42 Have the changes to layeranimation landed?
+ public:
+ ScreenRotation(View* root, float old_degrees, float new_degrees);
+ void CleanUp();
+
+ protected:
+ virtual ~ScreenRotation();
+
+ // implementation of ui::LayerAnimation
+ virtual void OnAnimationEnded() OVERRIDE;
+ virtual void OnAnimationProgressed(double t) OVERRIDE;
+
+ private:
+ int NormalizeAngle(int degrees);
+ void Init();
+
+ View* root_;
+ 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_

Powered by Google App Engine
This is Rietveld 408576698