OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ash/content/display/screen_orientation_controller_chromeos.h" | 5 #include "ash/content/display/screen_orientation_controller_chromeos.h" |
6 | 6 |
7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
8 #include "ash/display/display_info.h" | 8 #include "ash/display/display_info.h" |
9 #include "ash/display/display_manager.h" | 9 #include "ash/display/display_manager.h" |
10 #include "ash/rotator/screen_rotation_animator.h" | 10 #include "ash/rotator/screen_rotation_animator.h" |
(...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 if (screen_rotation_animator.CanAnimate()) { | 123 if (screen_rotation_animator.CanAnimate()) { |
124 screen_rotation_animator.Rotate(rotation, source); | 124 screen_rotation_animator.Rotate(rotation, source); |
125 } else { | 125 } else { |
126 // TODO(bruthig): Fix the DisplayManager so that display rotations set on | 126 // TODO(bruthig): Fix the DisplayManager so that display rotations set on |
127 // inactive displays are persisted. See www.crbug.com/480703. | 127 // inactive displays are persisted. See www.crbug.com/480703. |
128 Shell::GetInstance()->display_manager()->SetDisplayRotation( | 128 Shell::GetInstance()->display_manager()->SetDisplayRotation( |
129 gfx::Display::InternalDisplayId(), rotation, source); | 129 gfx::Display::InternalDisplayId(), rotation, source); |
130 } | 130 } |
131 } | 131 } |
132 | 132 |
133 void ScreenOrientationController::OnWindowActivated(aura::Window* gained_active, | 133 void ScreenOrientationController::OnWindowActivated( |
134 aura::Window* lost_active) { | 134 aura::client::ActivationChangeObserver::ActivationReason reason, |
| 135 aura::Window* gained_active, |
| 136 aura::Window* lost_active) { |
135 ApplyLockForActiveWindow(); | 137 ApplyLockForActiveWindow(); |
136 } | 138 } |
137 | 139 |
138 // Currently contents::WebContents will only be able to lock rotation while | 140 // Currently contents::WebContents will only be able to lock rotation while |
139 // fullscreen. In this state a user cannot click on the tab strip to change. If | 141 // fullscreen. In this state a user cannot click on the tab strip to change. If |
140 // this becomes supported for non-fullscreen tabs then the following interferes | 142 // this becomes supported for non-fullscreen tabs then the following interferes |
141 // with TabDragController. OnWindowVisibilityChanged is called between a mouse | 143 // with TabDragController. OnWindowVisibilityChanged is called between a mouse |
142 // down and mouse up. The rotation this triggers leads to a coordinate space | 144 // down and mouse up. The rotation this triggers leads to a coordinate space |
143 // change in the middle of an event. Causes the tab to separate from the tab | 145 // change in the middle of an event. Causes the tab to separate from the tab |
144 // strip. | 146 // strip. |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 } | 434 } |
433 | 435 |
434 bool ScreenOrientationController::CanRotateInLockedState() { | 436 bool ScreenOrientationController::CanRotateInLockedState() { |
435 return rotation_locked_orientation_ == | 437 return rotation_locked_orientation_ == |
436 blink::WebScreenOrientationLockLandscape || | 438 blink::WebScreenOrientationLockLandscape || |
437 rotation_locked_orientation_ == | 439 rotation_locked_orientation_ == |
438 blink::WebScreenOrientationLockPortrait; | 440 blink::WebScreenOrientationLockPortrait; |
439 } | 441 } |
440 | 442 |
441 } // namespace ash | 443 } // namespace ash |
OLD | NEW |