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 #include <utility> | 10 #include <utility> |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
372 NOTREACHED() << "Unknown rotation:" << current; | 372 NOTREACHED() << "Unknown rotation:" << current; |
373 return gfx::Display::ROTATE_0; | 373 return gfx::Display::ROTATE_0; |
374 } | 374 } |
375 | 375 |
376 // Rotates the screen. | 376 // Rotates the screen. |
377 void HandleRotateScreen() { | 377 void HandleRotateScreen() { |
378 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) | 378 if (Shell::GetInstance()->display_manager()->IsInUnifiedMode()) |
379 return; | 379 return; |
380 | 380 |
381 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); | 381 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); |
382 gfx::Point point = Shell::GetScreen()->GetCursorScreenPoint(); | 382 gfx::Point point = gfx::Screen::GetScreen()->GetCursorScreenPoint(); |
383 gfx::Display display = Shell::GetScreen()->GetDisplayNearestPoint(point); | 383 gfx::Display display = |
| 384 gfx::Screen::GetScreen()->GetDisplayNearestPoint(point); |
384 const DisplayInfo& display_info = | 385 const DisplayInfo& display_info = |
385 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); | 386 Shell::GetInstance()->display_manager()->GetDisplayInfo(display.id()); |
386 ash::ScreenRotationAnimator(display.id()) | 387 ash::ScreenRotationAnimator(display.id()) |
387 .Rotate(GetNextRotation(display_info.GetActiveRotation()), | 388 .Rotate(GetNextRotation(display_info.GetActiveRotation()), |
388 gfx::Display::ROTATION_SOURCE_USER); | 389 gfx::Display::ROTATION_SOURCE_USER); |
389 } | 390 } |
390 | 391 |
391 // Rotate the active window. | 392 // Rotate the active window. |
392 void HandleRotateActiveWindow() { | 393 void HandleRotateActiveWindow() { |
393 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); | 394 base::RecordAction(UserMetricsAction("Accel_Rotate_Window")); |
(...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1450 } | 1451 } |
1451 | 1452 |
1452 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1453 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
1453 scoped_ptr<KeyboardBrightnessControlDelegate> | 1454 scoped_ptr<KeyboardBrightnessControlDelegate> |
1454 keyboard_brightness_control_delegate) { | 1455 keyboard_brightness_control_delegate) { |
1455 keyboard_brightness_control_delegate_ = | 1456 keyboard_brightness_control_delegate_ = |
1456 std::move(keyboard_brightness_control_delegate); | 1457 std::move(keyboard_brightness_control_delegate); |
1457 } | 1458 } |
1458 | 1459 |
1459 } // namespace ash | 1460 } // namespace ash |
OLD | NEW |