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

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: Removed unnecessary #include from screen_orientation_controller_chromeos_unittest.cc. 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 8517759d6975210185e5bbd83bad9695e7babfcb..9b746b6821a04ea20bab0f03aca94f018b063812 100644
--- a/ash/rotator/screen_rotation_animator.cc
+++ b/ash/rotator/screen_rotation_animator.cc
@@ -279,6 +279,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,
gfx::Display::RotationSource source) {
const gfx::Display::Rotation current_rotation =

Powered by Google App Engine
This is Rietveld 408576698