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

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: 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 dbd44652a2e6b39e6463ddcf4ada549c79e477db..c64f3793b6561eab8d4b7ced21a7535011ba5307 100644
--- a/ash/content/display/screen_orientation_controller_chromeos.cc
+++ b/ash/content/display/screen_orientation_controller_chromeos.cc
@@ -116,11 +116,21 @@ void ScreenOrientationController::SetDisplayRotation(
DisplayManager* display_manager = Shell::GetInstance()->display_manager();
if (!display_manager->HasInternalDisplay())
return;
+
current_rotation_ = rotation;
base::AutoReset<bool> auto_ignore_display_configuration_updates(
&ignore_display_configuration_updates_, true);
- ash::ScreenRotationAnimator(gfx::Display::InternalDisplayId())
- .Rotate(rotation);
+
+ ash::ScreenRotationAnimator screen_rotation_animator(
+ gfx::Display::InternalDisplayId());
+ if (screen_rotation_animator.CanAnimate()) {
+ screen_rotation_animator.Rotate(rotation);
+ } 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(
jonross 2015/04/24 14:18:08 Use the display manager from 116
bruthig 2015/04/24 16:17:12 display manager no longer exists.
jonross 2015/04/24 17:08:30 Acknowledged.
+ gfx::Display::InternalDisplayId(), rotation);
+ }
}
void ScreenOrientationController::OnWindowActivated(aura::Window* gained_active,

Powered by Google App Engine
This is Rietveld 408576698