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

Unified Diff: ash/rotator/screen_rotation_animator.h

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.h
diff --git a/ash/rotator/screen_rotation_animator.h b/ash/rotator/screen_rotation_animator.h
index 055e755906dc483d95f4da29cc666749d893eb66..5470d0ae235986509b24d1564c027d0c6526a242 100644
--- a/ash/rotator/screen_rotation_animator.h
+++ b/ash/rotator/screen_rotation_animator.h
@@ -17,7 +17,15 @@ class ASH_EXPORT ScreenRotationAnimator {
explicit ScreenRotationAnimator(int64 display_id);
~ScreenRotationAnimator();
- // Rotates |display_| to the |new_rotation| orientation.
+ // Returns true if the screen rotation animation can be completed
+ // successfully. For example an animation is not possible if |display_id_|
+ // specifies a gfx::Display that is not currently active. See
+ // www.crbug.com/479503.
+ bool CanAnimate() const;
+
+ // Rotates the gfx::Display specified by |display_id_| to the |new_rotation|
+ // orientation. Clients should only call |Rotate(gfx::Display::Rotation)| if
+ // |CanAnimate()| returns true.
void Rotate(gfx::Display::Rotation new_rotation);
private:

Powered by Google App Engine
This is Rietveld 408576698