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/wm/maximize_mode/maximize_mode_controller.h" | 5 #include "ash/wm/maximize_mode/maximize_mode_controller.h" |
6 | 6 |
7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
8 #include "ash/accelerators/accelerator_table.h" | 8 #include "ash/accelerators/accelerator_table.h" |
9 #include "ash/accelerometer/accelerometer_controller.h" | 9 #include "ash/accelerometer/accelerometer_controller.h" |
10 #include "ash/ash_switches.h" | 10 #include "ash/ash_switches.h" |
(...skipping 280 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
291 new_rotation = gfx::Display::ROTATE_270; | 291 new_rotation = gfx::Display::ROTATE_270; |
292 else if (angle < 270.0f) | 292 else if (angle < 270.0f) |
293 new_rotation = gfx::Display::ROTATE_180; | 293 new_rotation = gfx::Display::ROTATE_180; |
294 | 294 |
295 // When exiting maximize mode return rotation to 0. When entering, rotate to | 295 // When exiting maximize mode return rotation to 0. When entering, rotate to |
296 // match screen orientation. | 296 // match screen orientation. |
297 if (new_rotation == gfx::Display::ROTATE_0 || | 297 if (new_rotation == gfx::Display::ROTATE_0 || |
298 maximize_mode_engaged) { | 298 maximize_mode_engaged) { |
299 SetDisplayRotation(display_manager, | 299 SetDisplayRotation(display_manager, |
300 new_rotation); | 300 new_rotation); |
301 aura::Window* window(Shell::GetPrimaryRootWindow()); | |
flackr
2014/05/26 20:36:45
Should get the internal display root window rather
| |
302 window->layer()->GetAnimator()->StopAnimating(); | |
301 } | 303 } |
302 } | 304 } |
303 | 305 |
304 void MaximizeModeController::SetDisplayRotation( | 306 void MaximizeModeController::SetDisplayRotation( |
305 DisplayManager* display_manager, | 307 DisplayManager* display_manager, |
306 gfx::Display::Rotation rotation) { | 308 gfx::Display::Rotation rotation) { |
307 base::AutoReset<bool> auto_in_set_screen_rotation( | 309 base::AutoReset<bool> auto_in_set_screen_rotation( |
308 &in_set_screen_rotation_, true); | 310 &in_set_screen_rotation_, true); |
309 display_manager->SetDisplayRotation(gfx::Display::InternalDisplayId(), | 311 display_manager->SetDisplayRotation(gfx::Display::InternalDisplayId(), |
310 rotation); | 312 rotation); |
313 aura::Window* window(Shell::GetPrimaryRootWindow()); | |
314 window->layer()->GetAnimator()->StopAnimating(); | |
311 } | 315 } |
312 | 316 |
313 } // namespace ash | 317 } // namespace ash |
OLD | NEW |