| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/accelerators/accelerator_controller.h" | 5 #include "ash/accelerators/accelerator_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 288 } | 288 } |
| 289 | 289 |
| 290 // Rotates the screen. | 290 // Rotates the screen. |
| 291 void HandleRotateScreen() { | 291 void HandleRotateScreen() { |
| 292 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); | 292 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); |
| 293 gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint(); | 293 gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint(); |
| 294 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point); | 294 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point); |
| 295 const DisplayInfo& display_info = | 295 const DisplayInfo& display_info = |
| 296 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); | 296 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); |
| 297 ash::ScreenRotationAnimator(display.id()) | 297 ash::ScreenRotationAnimator(display.id()) |
| 298 .Rotate(GetNextRotation(display_info.rotation())); | 298 .Rotate(GetNextRotation(display_info.GetActiveRotation()), |
| 299 gfx::Display::ROTATION_SOURCE_USER); |
| 299 } | 300 } |
| 300 | 301 |
| 301 // Rotate the active window. | 302 // Rotate the active window. |
| 302 void HandleRotateActiveWindow() { | 303 void HandleRotateActiveWindow() { |
| 303 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); | 304 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); |
| 304 aura::Window* active_window = wm::GetActiveWindow(); | 305 aura::Window* active_window = wm::GetActiveWindow(); |
| 305 if (active_window) { | 306 if (active_window) { |
| 306 // The rotation animation bases its target transform on the current | 307 // The rotation animation bases its target transform on the current |
| 307 // rotation and position. Since there could be an animation in progress | 308 // rotation and position. Since there could be an animation in progress |
| 308 // right now, queue this animation so when it starts it picks up a neutral | 309 // right now, queue this animation so when it starts it picks up a neutral |
| (...skipping 1020 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1329 } | 1330 } |
| 1330 | 1331 |
| 1331 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1332 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1332 scoped_ptr<KeyboardBrightnessControlDelegate> | 1333 scoped_ptr<KeyboardBrightnessControlDelegate> |
| 1333 keyboard_brightness_control_delegate) { | 1334 keyboard_brightness_control_delegate) { |
| 1334 keyboard_brightness_control_delegate_ = | 1335 keyboard_brightness_control_delegate_ = |
| 1335 keyboard_brightness_control_delegate.Pass(); | 1336 keyboard_brightness_control_delegate.Pass(); |
| 1336 } | 1337 } |
| 1337 | 1338 |
| 1338 } // namespace ash | 1339 } // namespace ash |
| OLD | NEW |