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

Unified Diff: ash/rotator/screen_rotation_animator.cc

Issue 1108343002: Revert of Merge Prevent DisplayPreferences from saving incorrect rotations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2357
Patch Set: Created 5 years, 8 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/screen_rotation_animator.h ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/rotator/screen_rotation_animator.cc
diff --git a/ash/rotator/screen_rotation_animator.cc b/ash/rotator/screen_rotation_animator.cc
index 87562191ae5e17eefe0709c9c73154702afbbce7..ed37b7f1da31bb7d519193ea8c29d999fb91e8a8 100644
--- a/ash/rotator/screen_rotation_animator.cc
+++ b/ash/rotator/screen_rotation_animator.cc
@@ -67,7 +67,7 @@
return Shell::GetInstance()
->display_manager()
->GetDisplayInfo(display_id)
- .GetActiveRotation();
+ .rotation();
}
// Returns true if the rotation between |initial_rotation| and |new_rotation| is
@@ -154,7 +154,6 @@
// animate the change.
void RotateScreen(int64 display_id,
gfx::Display::Rotation new_rotation,
- gfx::Display::RotationSource source,
base::TimeDelta duration,
int rotation_degrees,
int rotation_degree_offset,
@@ -182,8 +181,8 @@
scoped_ptr<LayerCleanupObserver> layer_cleanup_observer(
new LayerCleanupObserver(old_layer_tree.Pass()));
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
- display_id, new_rotation, source);
+ Shell::GetInstance()->display_manager()->SetDisplayRotation(display_id,
+ new_rotation);
const gfx::RectF rotated_screen_bounds = root_window->GetTargetBounds();
const gfx::Point pivot = gfx::Point(rotated_screen_bounds.width() / 2,
@@ -268,8 +267,7 @@
ScreenRotationAnimator::~ScreenRotationAnimator() {
}
-void ScreenRotationAnimator::Rotate(gfx::Display::Rotation new_rotation,
- gfx::Display::RotationSource source) {
+void ScreenRotationAnimator::Rotate(gfx::Display::Rotation new_rotation) {
const gfx::Display::Rotation current_rotation =
GetCurrentRotation(display_id_);
@@ -281,8 +279,8 @@
switches::kAshEnableScreenRotationAnimation);
if (switch_value == kRotationAnimation_None) {
- Shell::GetInstance()->display_manager()->SetDisplayRotation(
- display_id_, new_rotation, source);
+ Shell::GetInstance()->display_manager()->SetDisplayRotation(display_id_,
+ new_rotation);
} else if (kRotationAnimation_Default == switch_value ||
kRotationAnimation_Partial == switch_value) {
const int rotation_degree_offset =
@@ -290,7 +288,7 @@
? 180 - kPartialRotationDegrees
: 90 - kPartialRotationDegrees;
- RotateScreen(display_id_, new_rotation, source,
+ RotateScreen(display_id_, new_rotation,
base::TimeDelta::FromMilliseconds(kRotationDurationInMs),
kPartialRotationDegrees, rotation_degree_offset,
gfx::Tween::FAST_OUT_LINEAR_IN, false /* should_scale */);
@@ -298,7 +296,7 @@
const int rotation_degrees =
Is180DegreeFlip(current_rotation, new_rotation) ? 180 : 90;
- RotateScreen(display_id_, new_rotation, source,
+ RotateScreen(display_id_, new_rotation,
base::TimeDelta::FromMilliseconds(kRotationDurationInMs),
rotation_degrees, 0 /* rotation_degree_offset */,
gfx::Tween::FAST_OUT_LINEAR_IN, true /* should_scale */);
« no previous file with comments | « ash/rotator/screen_rotation_animator.h ('k') | ash/system/audio/tray_audio.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698