| 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 |
| 11 #include "ash/accelerators/accelerator_commands.h" | 11 #include "ash/accelerators/accelerator_commands.h" |
| 12 #include "ash/accelerators/debug_commands.h" | 12 #include "ash/accelerators/debug_commands.h" |
| 13 #include "ash/surfaces/test_surface_overlay_view.h" |
| 13 #include "ash/ash_switches.h" | 14 #include "ash/ash_switches.h" |
| 14 #include "ash/debug.h" | 15 #include "ash/debug.h" |
| 15 #include "ash/display/window_tree_host_manager.h" | 16 #include "ash/display/window_tree_host_manager.h" |
| 16 #include "ash/focus_cycler.h" | 17 #include "ash/focus_cycler.h" |
| 17 #include "ash/gpu_support.h" | 18 #include "ash/gpu_support.h" |
| 18 #include "ash/ime_control_delegate.h" | 19 #include "ash/ime_control_delegate.h" |
| 19 #include "ash/magnifier/magnification_controller.h" | 20 #include "ash/magnifier/magnification_controller.h" |
| 20 #include "ash/magnifier/partial_magnification_controller.h" | 21 #include "ash/magnifier/partial_magnification_controller.h" |
| 21 #include "ash/media_delegate.h" | 22 #include "ash/media_delegate.h" |
| 22 #include "ash/multi_profile_uma.h" | 23 #include "ash/multi_profile_uma.h" |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // right now, queue this animation so when it starts it picks up a neutral | 343 // right now, queue this animation so when it starts it picks up a neutral |
| 343 // rotation and position. Use replace so we only enqueue one at a time. | 344 // rotation and position. Use replace so we only enqueue one at a time. |
| 344 active_window->layer()->GetAnimator()-> | 345 active_window->layer()->GetAnimator()-> |
| 345 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); | 346 set_preemption_strategy(ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS); |
| 346 active_window->layer()->GetAnimator()->StartAnimation( | 347 active_window->layer()->GetAnimator()->StartAnimation( |
| 347 new ui::LayerAnimationSequence( | 348 new ui::LayerAnimationSequence( |
| 348 new ash::WindowRotation(360, active_window->layer()))); | 349 new ash::WindowRotation(360, active_window->layer()))); |
| 349 } | 350 } |
| 350 } | 351 } |
| 351 | 352 |
| 353 void HandleShowTestSurfaceOverlay() { |
| 354 base::RecordAction(UserMetricsAction("Accel_Show_Test_Surface_Overlay")); |
| 355 TestSurfaceOverlayView::Show(); |
| 356 } |
| 357 |
| 352 void HandleShowKeyboardOverlay() { | 358 void HandleShowKeyboardOverlay() { |
| 353 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); | 359 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); |
| 354 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); | 360 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); |
| 355 } | 361 } |
| 356 | 362 |
| 357 bool CanHandleShowMessageCenterBubble() { | 363 bool CanHandleShowMessageCenterBubble() { |
| 358 RootWindowController* controller = | 364 RootWindowController* controller = |
| 359 RootWindowController::ForTargetRootWindow(); | 365 RootWindowController::ForTargetRootWindow(); |
| 360 StatusAreaWidget* status_area_widget = | 366 StatusAreaWidget* status_area_widget = |
| 361 controller->shelf()->status_area_widget(); | 367 controller->shelf()->status_area_widget(); |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1017 case MEDIA_NEXT_TRACK: | 1023 case MEDIA_NEXT_TRACK: |
| 1018 case MEDIA_PLAY_PAUSE: | 1024 case MEDIA_PLAY_PAUSE: |
| 1019 case MEDIA_PREV_TRACK: | 1025 case MEDIA_PREV_TRACK: |
| 1020 case NEW_TAB: | 1026 case NEW_TAB: |
| 1021 case NEW_WINDOW: | 1027 case NEW_WINDOW: |
| 1022 case OPEN_FEEDBACK_PAGE: | 1028 case OPEN_FEEDBACK_PAGE: |
| 1023 case PRINT_UI_HIERARCHIES: | 1029 case PRINT_UI_HIERARCHIES: |
| 1024 case RESTORE_TAB: | 1030 case RESTORE_TAB: |
| 1025 case ROTATE_SCREEN: | 1031 case ROTATE_SCREEN: |
| 1026 case ROTATE_WINDOW: | 1032 case ROTATE_WINDOW: |
| 1033 case SHOW_TEST_SURFACE_OVERLAY: |
| 1027 case SHOW_KEYBOARD_OVERLAY: | 1034 case SHOW_KEYBOARD_OVERLAY: |
| 1028 case SHOW_SYSTEM_TRAY_BUBBLE: | 1035 case SHOW_SYSTEM_TRAY_BUBBLE: |
| 1029 case SHOW_TASK_MANAGER: | 1036 case SHOW_TASK_MANAGER: |
| 1030 case TAKE_PARTIAL_SCREENSHOT: | 1037 case TAKE_PARTIAL_SCREENSHOT: |
| 1031 case TAKE_SCREENSHOT: | 1038 case TAKE_SCREENSHOT: |
| 1032 case TOGGLE_FULLSCREEN: | 1039 case TOGGLE_FULLSCREEN: |
| 1033 case TOGGLE_MAXIMIZED: | 1040 case TOGGLE_MAXIMIZED: |
| 1034 case TOGGLE_OVERVIEW: | 1041 case TOGGLE_OVERVIEW: |
| 1035 case WINDOW_MINIMIZE: | 1042 case WINDOW_MINIMIZE: |
| 1036 #if defined(OS_CHROMEOS) | 1043 #if defined(OS_CHROMEOS) |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1177 break; | 1184 break; |
| 1178 case SCALE_UI_DOWN: | 1185 case SCALE_UI_DOWN: |
| 1179 accelerators::ZoomInternalDisplay(false /* down */); | 1186 accelerators::ZoomInternalDisplay(false /* down */); |
| 1180 break; | 1187 break; |
| 1181 case SCALE_UI_RESET: | 1188 case SCALE_UI_RESET: |
| 1182 accelerators::ResetInternalDisplayZoom(); | 1189 accelerators::ResetInternalDisplayZoom(); |
| 1183 break; | 1190 break; |
| 1184 case SCALE_UI_UP: | 1191 case SCALE_UI_UP: |
| 1185 accelerators::ZoomInternalDisplay(true /* up */); | 1192 accelerators::ZoomInternalDisplay(true /* up */); |
| 1186 break; | 1193 break; |
| 1194 case SHOW_TEST_SURFACE_OVERLAY: |
| 1195 HandleShowTestSurfaceOverlay(); |
| 1196 break; |
| 1187 case SHOW_KEYBOARD_OVERLAY: | 1197 case SHOW_KEYBOARD_OVERLAY: |
| 1188 HandleShowKeyboardOverlay(); | 1198 HandleShowKeyboardOverlay(); |
| 1189 break; | 1199 break; |
| 1190 case SHOW_MESSAGE_CENTER_BUBBLE: | 1200 case SHOW_MESSAGE_CENTER_BUBBLE: |
| 1191 HandleShowMessageCenterBubble(); | 1201 HandleShowMessageCenterBubble(); |
| 1192 break; | 1202 break; |
| 1193 case SHOW_SYSTEM_TRAY_BUBBLE: | 1203 case SHOW_SYSTEM_TRAY_BUBBLE: |
| 1194 HandleShowSystemTrayBubble(); | 1204 HandleShowSystemTrayBubble(); |
| 1195 break; | 1205 break; |
| 1196 case SHOW_TASK_MANAGER: | 1206 case SHOW_TASK_MANAGER: |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1385 } | 1395 } |
| 1386 | 1396 |
| 1387 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1397 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
| 1388 scoped_ptr<KeyboardBrightnessControlDelegate> | 1398 scoped_ptr<KeyboardBrightnessControlDelegate> |
| 1389 keyboard_brightness_control_delegate) { | 1399 keyboard_brightness_control_delegate) { |
| 1390 keyboard_brightness_control_delegate_ = | 1400 keyboard_brightness_control_delegate_ = |
| 1391 keyboard_brightness_control_delegate.Pass(); | 1401 keyboard_brightness_control_delegate.Pass(); |
| 1392 } | 1402 } |
| 1393 | 1403 |
| 1394 } // namespace ash | 1404 } // namespace ash |
| OLD | NEW |