| 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 <iostream> | 9 #include <iostream> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 #include "ui/aura/root_window.h" | 60 #include "ui/aura/root_window.h" |
| 61 #include "ui/base/accelerators/accelerator.h" | 61 #include "ui/base/accelerators/accelerator.h" |
| 62 #include "ui/base/accelerators/accelerator_manager.h" | 62 #include "ui/base/accelerators/accelerator_manager.h" |
| 63 #include "ui/compositor/debug_utils.h" | 63 #include "ui/compositor/debug_utils.h" |
| 64 #include "ui/compositor/layer.h" | 64 #include "ui/compositor/layer.h" |
| 65 #include "ui/compositor/layer_animation_sequence.h" | 65 #include "ui/compositor/layer_animation_sequence.h" |
| 66 #include "ui/compositor/layer_animator.h" | 66 #include "ui/compositor/layer_animator.h" |
| 67 #include "ui/events/event.h" | 67 #include "ui/events/event.h" |
| 68 #include "ui/events/keycodes/keyboard_codes.h" | 68 #include "ui/events/keycodes/keyboard_codes.h" |
| 69 #include "ui/gfx/screen.h" | 69 #include "ui/gfx/screen.h" |
| 70 #include "ui/oak/oak.h" | |
| 71 #include "ui/views/controls/webview/webview.h" | 70 #include "ui/views/controls/webview/webview.h" |
| 72 #include "ui/views/debug_utils.h" | 71 #include "ui/views/debug_utils.h" |
| 73 #include "ui/views/widget/widget.h" | 72 #include "ui/views/widget/widget.h" |
| 74 | 73 |
| 75 #if defined(OS_CHROMEOS) | 74 #if defined(OS_CHROMEOS) |
| 76 #include "ash/session_state_delegate.h" | 75 #include "ash/session_state_delegate.h" |
| 77 #include "ash/system/chromeos/keyboard_brightness_controller.h" | 76 #include "ash/system/chromeos/keyboard_brightness_controller.h" |
| 78 #include "base/sys_info.h" | 77 #include "base/sys_info.h" |
| 79 #endif // defined(OS_CHROMEOS) | 78 #endif // defined(OS_CHROMEOS) |
| 80 | 79 |
| (...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 internal::StatusAreaWidget* status_area_widget = | 447 internal::StatusAreaWidget* status_area_widget = |
| 449 controller->shelf()->status_area_widget(); | 448 controller->shelf()->status_area_widget(); |
| 450 if (status_area_widget) { | 449 if (status_area_widget) { |
| 451 WebNotificationTray* notification_tray = | 450 WebNotificationTray* notification_tray = |
| 452 status_area_widget->web_notification_tray(); | 451 status_area_widget->web_notification_tray(); |
| 453 if (notification_tray->visible()) | 452 if (notification_tray->visible()) |
| 454 notification_tray->ShowMessageCenterBubble(); | 453 notification_tray->ShowMessageCenterBubble(); |
| 455 } | 454 } |
| 456 } | 455 } |
| 457 | 456 |
| 458 bool HandleShowOak() { | |
| 459 if (CommandLine::ForCurrentProcess()->HasSwitch( | |
| 460 switches::kAshEnableOak)) { | |
| 461 oak::ShowOakWindowWithContext(Shell::GetPrimaryRootWindow()); | |
| 462 return true; | |
| 463 } | |
| 464 return false; | |
| 465 } | |
| 466 | |
| 467 bool HandleShowSystemTrayBubble() { | 457 bool HandleShowSystemTrayBubble() { |
| 468 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); | 458 base::RecordAction(UserMetricsAction("Accel_Show_System_Tray_Bubble")); |
| 469 internal::RootWindowController* controller = | 459 internal::RootWindowController* controller = |
| 470 internal::RootWindowController::ForTargetRootWindow(); | 460 internal::RootWindowController::ForTargetRootWindow(); |
| 471 if (!controller->GetSystemTray()->HasSystemBubble()) { | 461 if (!controller->GetSystemTray()->HasSystemBubble()) { |
| 472 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); | 462 controller->GetSystemTray()->ShowDefaultView(BUBBLE_CREATE_NEW); |
| 473 return true; | 463 return true; |
| 474 } | 464 } |
| 475 return false; | 465 return false; |
| 476 } | 466 } |
| (...skipping 555 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1032 return volume_delegate && volume_delegate->HandleVolumeUp(accelerator); | 1022 return volume_delegate && volume_delegate->HandleVolumeUp(accelerator); |
| 1033 } | 1023 } |
| 1034 case FOCUS_LAUNCHER: | 1024 case FOCUS_LAUNCHER: |
| 1035 return HandleFocusLauncher(); | 1025 return HandleFocusLauncher(); |
| 1036 case FOCUS_NEXT_PANE: | 1026 case FOCUS_NEXT_PANE: |
| 1037 return HandleRotatePaneFocus(Shell::FORWARD); | 1027 return HandleRotatePaneFocus(Shell::FORWARD); |
| 1038 case FOCUS_PREVIOUS_PANE: | 1028 case FOCUS_PREVIOUS_PANE: |
| 1039 return HandleRotatePaneFocus(Shell::BACKWARD); | 1029 return HandleRotatePaneFocus(Shell::BACKWARD); |
| 1040 case SHOW_KEYBOARD_OVERLAY: | 1030 case SHOW_KEYBOARD_OVERLAY: |
| 1041 return HandleShowKeyboardOverlay(); | 1031 return HandleShowKeyboardOverlay(); |
| 1042 case SHOW_OAK: | |
| 1043 return HandleShowOak(); | |
| 1044 case SHOW_SYSTEM_TRAY_BUBBLE: | 1032 case SHOW_SYSTEM_TRAY_BUBBLE: |
| 1045 return HandleShowSystemTrayBubble(); | 1033 return HandleShowSystemTrayBubble(); |
| 1046 case SHOW_MESSAGE_CENTER_BUBBLE: | 1034 case SHOW_MESSAGE_CENTER_BUBBLE: |
| 1047 HandleShowMessageCenterBubble(); | 1035 HandleShowMessageCenterBubble(); |
| 1048 break; | 1036 break; |
| 1049 case SHOW_TASK_MANAGER: | 1037 case SHOW_TASK_MANAGER: |
| 1050 return HandleShowTaskManager(); | 1038 return HandleShowTaskManager(); |
| 1051 case NEXT_IME: | 1039 case NEXT_IME: |
| 1052 return HandleNextIme( | 1040 return HandleNextIme( |
| 1053 ime_control_delegate_.get(), previous_event_type, previous_key_code); | 1041 ime_control_delegate_.get(), previous_event_type, previous_key_code); |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1206 keyboard_brightness_control_delegate) { | 1194 keyboard_brightness_control_delegate) { |
| 1207 keyboard_brightness_control_delegate_ = | 1195 keyboard_brightness_control_delegate_ = |
| 1208 keyboard_brightness_control_delegate.Pass(); | 1196 keyboard_brightness_control_delegate.Pass(); |
| 1209 } | 1197 } |
| 1210 | 1198 |
| 1211 bool AcceleratorController::CanHandleAccelerators() const { | 1199 bool AcceleratorController::CanHandleAccelerators() const { |
| 1212 return true; | 1200 return true; |
| 1213 } | 1201 } |
| 1214 | 1202 |
| 1215 } // namespace ash | 1203 } // namespace ash |
| OLD | NEW |