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 15 matching lines...) Expand all Loading... |
26 #include "ash/rotator/window_rotation.h" | 26 #include "ash/rotator/window_rotation.h" |
27 #include "ash/screenshot_delegate.h" | 27 #include "ash/screenshot_delegate.h" |
28 #include "ash/session/session_state_delegate.h" | 28 #include "ash/session/session_state_delegate.h" |
29 #include "ash/shelf/shelf.h" | 29 #include "ash/shelf/shelf.h" |
30 #include "ash/shelf/shelf_delegate.h" | 30 #include "ash/shelf/shelf_delegate.h" |
31 #include "ash/shelf/shelf_model.h" | 31 #include "ash/shelf/shelf_model.h" |
32 #include "ash/shelf/shelf_widget.h" | 32 #include "ash/shelf/shelf_widget.h" |
33 #include "ash/shell.h" | 33 #include "ash/shell.h" |
34 #include "ash/shell_delegate.h" | 34 #include "ash/shell_delegate.h" |
35 #include "ash/shell_window_ids.h" | 35 #include "ash/shell_window_ids.h" |
| 36 #include "ash/surfaces/test_shell_surface_overlay_view.h" |
36 #include "ash/system/brightness_control_delegate.h" | 37 #include "ash/system/brightness_control_delegate.h" |
37 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" | 38 #include "ash/system/keyboard_brightness/keyboard_brightness_control_delegate.h" |
38 #include "ash/system/status_area_widget.h" | 39 #include "ash/system/status_area_widget.h" |
39 #include "ash/system/system_notifier.h" | 40 #include "ash/system/system_notifier.h" |
40 #include "ash/system/tray/system_tray.h" | 41 #include "ash/system/tray/system_tray.h" |
41 #include "ash/system/tray/system_tray_delegate.h" | 42 #include "ash/system/tray/system_tray_delegate.h" |
42 #include "ash/system/tray/system_tray_notifier.h" | 43 #include "ash/system/tray/system_tray_notifier.h" |
43 #include "ash/system/web_notification/web_notification_tray.h" | 44 #include "ash/system/web_notification/web_notification_tray.h" |
44 #include "ash/touch/touch_hud_debug.h" | 45 #include "ash/touch/touch_hud_debug.h" |
45 #include "ash/utility/partial_screenshot_controller.h" | 46 #include "ash/utility/partial_screenshot_controller.h" |
(...skipping 296 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 HandleShowTestShellSurfaceOverlay() { |
| 354 base::RecordAction( |
| 355 UserMetricsAction("Accel_Show_Test_Shell_Surface_Overlay")); |
| 356 TestShellSurfaceOverlayView::Show(); |
| 357 } |
| 358 |
| 359 void HandleShowFullscreenTestShellSurfaceOverlay() { |
| 360 base::RecordAction( |
| 361 UserMetricsAction("Accel_Show_Fullscreen_Test_Shell_Surface_Overlay")); |
| 362 TestShellSurfaceOverlayView::ShowFullscreen(); |
| 363 } |
| 364 |
352 void HandleShowKeyboardOverlay() { | 365 void HandleShowKeyboardOverlay() { |
353 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); | 366 base::RecordAction(UserMetricsAction("Accel_Show_Keyboard_Overlay")); |
354 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); | 367 ash::Shell::GetInstance()->new_window_delegate()->ShowKeyboardOverlay(); |
355 } | 368 } |
356 | 369 |
357 bool CanHandleShowMessageCenterBubble() { | 370 bool CanHandleShowMessageCenterBubble() { |
358 RootWindowController* controller = | 371 RootWindowController* controller = |
359 RootWindowController::ForTargetRootWindow(); | 372 RootWindowController::ForTargetRootWindow(); |
360 StatusAreaWidget* status_area_widget = | 373 StatusAreaWidget* status_area_widget = |
361 controller->shelf()->status_area_widget(); | 374 controller->shelf()->status_area_widget(); |
(...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1017 case MEDIA_NEXT_TRACK: | 1030 case MEDIA_NEXT_TRACK: |
1018 case MEDIA_PLAY_PAUSE: | 1031 case MEDIA_PLAY_PAUSE: |
1019 case MEDIA_PREV_TRACK: | 1032 case MEDIA_PREV_TRACK: |
1020 case NEW_TAB: | 1033 case NEW_TAB: |
1021 case NEW_WINDOW: | 1034 case NEW_WINDOW: |
1022 case OPEN_FEEDBACK_PAGE: | 1035 case OPEN_FEEDBACK_PAGE: |
1023 case PRINT_UI_HIERARCHIES: | 1036 case PRINT_UI_HIERARCHIES: |
1024 case RESTORE_TAB: | 1037 case RESTORE_TAB: |
1025 case ROTATE_SCREEN: | 1038 case ROTATE_SCREEN: |
1026 case ROTATE_WINDOW: | 1039 case ROTATE_WINDOW: |
| 1040 case SHOW_TEST_SHELL_SURFACE_OVERLAY: |
| 1041 case SHOW_FULLSCREEN_TEST_SHELL_SURFACE_OVERLAY: |
1027 case SHOW_KEYBOARD_OVERLAY: | 1042 case SHOW_KEYBOARD_OVERLAY: |
1028 case SHOW_SYSTEM_TRAY_BUBBLE: | 1043 case SHOW_SYSTEM_TRAY_BUBBLE: |
1029 case SHOW_TASK_MANAGER: | 1044 case SHOW_TASK_MANAGER: |
1030 case TAKE_PARTIAL_SCREENSHOT: | 1045 case TAKE_PARTIAL_SCREENSHOT: |
1031 case TAKE_SCREENSHOT: | 1046 case TAKE_SCREENSHOT: |
1032 case TOGGLE_FULLSCREEN: | 1047 case TOGGLE_FULLSCREEN: |
1033 case TOGGLE_MAXIMIZED: | 1048 case TOGGLE_MAXIMIZED: |
1034 case TOGGLE_OVERVIEW: | 1049 case TOGGLE_OVERVIEW: |
1035 case WINDOW_MINIMIZE: | 1050 case WINDOW_MINIMIZE: |
1036 #if defined(OS_CHROMEOS) | 1051 #if defined(OS_CHROMEOS) |
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1177 break; | 1192 break; |
1178 case SCALE_UI_DOWN: | 1193 case SCALE_UI_DOWN: |
1179 accelerators::ZoomInternalDisplay(false /* down */); | 1194 accelerators::ZoomInternalDisplay(false /* down */); |
1180 break; | 1195 break; |
1181 case SCALE_UI_RESET: | 1196 case SCALE_UI_RESET: |
1182 accelerators::ResetInternalDisplayZoom(); | 1197 accelerators::ResetInternalDisplayZoom(); |
1183 break; | 1198 break; |
1184 case SCALE_UI_UP: | 1199 case SCALE_UI_UP: |
1185 accelerators::ZoomInternalDisplay(true /* up */); | 1200 accelerators::ZoomInternalDisplay(true /* up */); |
1186 break; | 1201 break; |
| 1202 case SHOW_TEST_SHELL_SURFACE_OVERLAY: |
| 1203 HandleShowTestShellSurfaceOverlay(); |
| 1204 break; |
| 1205 case SHOW_FULLSCREEN_TEST_SHELL_SURFACE_OVERLAY: |
| 1206 HandleShowFullscreenTestShellSurfaceOverlay(); |
| 1207 break; |
1187 case SHOW_KEYBOARD_OVERLAY: | 1208 case SHOW_KEYBOARD_OVERLAY: |
1188 HandleShowKeyboardOverlay(); | 1209 HandleShowKeyboardOverlay(); |
1189 break; | 1210 break; |
1190 case SHOW_MESSAGE_CENTER_BUBBLE: | 1211 case SHOW_MESSAGE_CENTER_BUBBLE: |
1191 HandleShowMessageCenterBubble(); | 1212 HandleShowMessageCenterBubble(); |
1192 break; | 1213 break; |
1193 case SHOW_SYSTEM_TRAY_BUBBLE: | 1214 case SHOW_SYSTEM_TRAY_BUBBLE: |
1194 HandleShowSystemTrayBubble(); | 1215 HandleShowSystemTrayBubble(); |
1195 break; | 1216 break; |
1196 case SHOW_TASK_MANAGER: | 1217 case SHOW_TASK_MANAGER: |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1385 } | 1406 } |
1386 | 1407 |
1387 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1408 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
1388 scoped_ptr<KeyboardBrightnessControlDelegate> | 1409 scoped_ptr<KeyboardBrightnessControlDelegate> |
1389 keyboard_brightness_control_delegate) { | 1410 keyboard_brightness_control_delegate) { |
1390 keyboard_brightness_control_delegate_ = | 1411 keyboard_brightness_control_delegate_ = |
1391 keyboard_brightness_control_delegate.Pass(); | 1412 keyboard_brightness_control_delegate.Pass(); |
1392 } | 1413 } |
1393 | 1414 |
1394 } // namespace ash | 1415 } // namespace ash |
OLD | NEW |