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.GetActiveRotation()), | 298 .Rotate(GetNextRotation(display_info.rotation())); |
299 gfx::Display::ROTATION_SOURCE_USER); | |
300 } | 299 } |
301 | 300 |
302 // Rotate the active window. | 301 // Rotate the active window. |
303 void HandleRotateActiveWindow() { | 302 void HandleRotateActiveWindow() { |
304 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); | 303 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); |
305 aura::Window* active_window = wm::GetActiveWindow(); | 304 aura::Window* active_window = wm::GetActiveWindow(); |
306 if (active_window) { | 305 if (active_window) { |
307 // The rotation animation bases its target transform on the current | 306 // The rotation animation bases its target transform on the current |
308 // rotation and position. Since there could be an animation in progress | 307 // rotation and position. Since there could be an animation in progress |
309 // right now, queue this animation so when it starts it picks up a neutral | 308 // 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... |
1330 } | 1329 } |
1331 | 1330 |
1332 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1331 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
1333 scoped_ptr<KeyboardBrightnessControlDelegate> | 1332 scoped_ptr<KeyboardBrightnessControlDelegate> |
1334 keyboard_brightness_control_delegate) { | 1333 keyboard_brightness_control_delegate) { |
1335 keyboard_brightness_control_delegate_ = | 1334 keyboard_brightness_control_delegate_ = |
1336 keyboard_brightness_control_delegate.Pass(); | 1335 keyboard_brightness_control_delegate.Pass(); |
1337 } | 1336 } |
1338 | 1337 |
1339 } // namespace ash | 1338 } // namespace ash |
OLD | NEW |