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

Unified Diff: ash/rotator/window_rotation.cc

Issue 975943002: Implemented screen rotation animation experiment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added ash-screen-rotation-animation entry to histograms.xml. Created 5 years, 9 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
« no previous file with comments | « ash/rotator/window_rotation.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/rotator/window_rotation.cc
diff --git a/ash/rotator/screen_rotation.cc b/ash/rotator/window_rotation.cc
similarity index 83%
rename from ash/rotator/screen_rotation.cc
rename to ash/rotator/window_rotation.cc
index 385362051313f91697890f3b9ae97ede2f9f7ecb..a82d4ac0b6b3d8d73484a461f2d445588d74557a 100644
--- a/ash/rotator/screen_rotation.cc
+++ b/ash/rotator/window_rotation.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ash/rotator/screen_rotation.h"
+#include "ash/rotator/window_rotation.h"
#include "base/time/time.h"
#include "ui/compositor/layer.h"
@@ -30,17 +30,17 @@ base::TimeDelta GetTransitionDuration(int degrees) {
} // namespace
-ScreenRotation::ScreenRotation(int degrees, ui::Layer* layer)
+WindowRotation::WindowRotation(int degrees, ui::Layer* layer)
: ui::LayerAnimationElement(LayerAnimationElement::TRANSFORM,
GetTransitionDuration(degrees)),
degrees_(degrees) {
InitTransform(layer);
}
-ScreenRotation::~ScreenRotation() {
+WindowRotation::~WindowRotation() {
}
-void ScreenRotation::InitTransform(ui::Layer* layer) {
+void WindowRotation::InitTransform(ui::Layer* layer) {
// No rotation required, use the identity transform.
if (degrees_ == 0) {
interpolated_transform_.reset(
@@ -79,14 +79,12 @@ void ScreenRotation::InitTransform(ui::Layer* layer) {
scoped_ptr<ui::InterpolatedTransform> rotation(
new ui::InterpolatedTransformAboutPivot(
- old_pivot,
- new ui::InterpolatedRotation(0, degrees_)));
+ old_pivot, new ui::InterpolatedRotation(0, degrees_)));
scoped_ptr<ui::InterpolatedTransform> translation(
new ui::InterpolatedTranslation(
- gfx::Point(0, 0),
- gfx::Point(new_pivot.x() - old_pivot.x(),
- new_pivot.y() - old_pivot.y())));
+ gfx::Point(0, 0), gfx::Point(new_pivot.x() - old_pivot.x(),
+ new_pivot.y() - old_pivot.y())));
float scale_factor = 0.9f;
scoped_ptr<ui::InterpolatedTransform> scale_down(
@@ -104,20 +102,20 @@ void ScreenRotation::InitTransform(ui::Layer* layer) {
interpolated_transform_->SetChild(rotation.release());
}
-void ScreenRotation::OnStart(ui::LayerAnimationDelegate* delegate) {
+void WindowRotation::OnStart(ui::LayerAnimationDelegate* delegate) {
}
-bool ScreenRotation::OnProgress(double t,
+bool WindowRotation::OnProgress(double t,
ui::LayerAnimationDelegate* delegate) {
delegate->SetTransformFromAnimation(interpolated_transform_->Interpolate(t));
return true;
}
-void ScreenRotation::OnGetTarget(TargetValue* target) const {
+void WindowRotation::OnGetTarget(TargetValue* target) const {
target->transform = interpolated_transform_->Interpolate(1.0);
}
-void ScreenRotation::OnAbort(ui::LayerAnimationDelegate* delegate) {
+void WindowRotation::OnAbort(ui::LayerAnimationDelegate* delegate) {
}
} // namespace ash
« no previous file with comments | « ash/rotator/window_rotation.h ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698