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

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: 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.h
diff --git a/ash/rotator/screen_rotation_animator.h b/ash/rotator/screen_rotation_animator.h
index 89c17848f46127fa81b3838751a1f779992b3884..6aff4327e7c8b574d59834b9b6a1ea4225dbf51e 100644
--- a/ash/rotator/screen_rotation_animator.h
+++ b/ash/rotator/screen_rotation_animator.h
@@ -17,8 +17,16 @@ class ASH_EXPORT ScreenRotationAnimator {
explicit ScreenRotationAnimator(int64 display_id);
~ScreenRotationAnimator();
- // Rotates |display_| to the |new_rotation| orientation, for the given
- // |source|. The rotation will also become active.
+ // 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, for the given |source|. The rotation will also become active.
+ // Clients should only call |Rotate(gfx::Display::Rotation)| if |CanAnimate()|
+ // returns true.
void Rotate(gfx::Display::Rotation new_rotation,
gfx::Display::RotationSource source);

Powered by Google App Engine
This is Rietveld 408576698