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

Unified Diff: ash/content/display/screen_orientation_controller_chromeos.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/content/display/screen_orientation_controller_chromeos.cc
diff --git a/ash/content/display/screen_orientation_controller_chromeos.cc b/ash/content/display/screen_orientation_controller_chromeos.cc
index bb4938cc08187be93409239095428932ee0b21a5..eee0ae6015cd503c72cbe5ec707a62039cb68064 100644
--- a/ash/content/display/screen_orientation_controller_chromeos.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos.cc
@@ -117,8 +117,17 @@ void ScreenOrientationController::SetDisplayRotation(
current_rotation_ = rotation;
base::AutoReset<bool> auto_ignore_display_configuration_updates(
&ignore_display_configuration_updates_, true);
- ash::ScreenRotationAnimator(gfx::Display::InternalDisplayId())
- .Rotate(rotation, source);
+
+ ash::ScreenRotationAnimator screen_rotation_animator(
+ gfx::Display::InternalDisplayId());
+ if (screen_rotation_animator.CanAnimate()) {
+ screen_rotation_animator.Rotate(rotation, source);
+ } else {
+ // TODO(bruthig): Fix the DisplayManager so that display rotations set on
+ // inactive displays are persisted. See www.crbug.com/480703.
+ Shell::GetInstance()->display_manager()->SetDisplayRotation(
+ gfx::Display::InternalDisplayId(), rotation, source);
+ }
}
void ScreenOrientationController::OnWindowActivated(aura::Window* gained_active,

Powered by Google App Engine
This is Rietveld 408576698