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

Unified Diff: ash/rotator/screen_rotation_animator.cc

Issue 1108473002: Fixed the ScreenOrientationController so that it doesn't crash by animating (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
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
Index: ash/rotator/screen_rotation_animator.cc
diff --git a/ash/rotator/screen_rotation_animator.cc b/ash/rotator/screen_rotation_animator.cc
index ed37b7f1da31bb7d519193ea8c29d999fb91e8a8..3d32e87642ee12412c893fc628b911c42f735f7b 100644
--- a/ash/rotator/screen_rotation_animator.cc
+++ b/ash/rotator/screen_rotation_animator.cc
@@ -267,6 +267,13 @@ ScreenRotationAnimator::ScreenRotationAnimator(int64 display_id)
ScreenRotationAnimator::~ScreenRotationAnimator() {
}
+bool ScreenRotationAnimator::CanAnimate() const {
+ return Shell::GetInstance()
+ ->display_manager()
+ ->GetDisplayForId(display_id_)
+ .is_valid();
+}
+
void ScreenRotationAnimator::Rotate(gfx::Display::Rotation new_rotation) {
const gfx::Display::Rotation current_rotation =
GetCurrentRotation(display_id_);

Powered by Google App Engine
This is Rietveld 408576698