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 <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/accelerators/accelerator_commands.h" | 9 #include "ash/accelerators/accelerator_commands.h" |
10 #include "ash/accelerators/accelerator_controller_delegate.h" | 10 #include "ash/accelerators/accelerator_controller_delegate.h" |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
43 #include "ash/wm/window_cycle_controller.h" | 43 #include "ash/wm/window_cycle_controller.h" |
44 #include "ash/wm/window_positioning_utils.h" | 44 #include "ash/wm/window_positioning_utils.h" |
45 #include "ash/wm/window_state.h" | 45 #include "ash/wm/window_state.h" |
46 #include "ash/wm/window_util.h" | 46 #include "ash/wm/window_util.h" |
47 #include "ash/wm/wm_event.h" | 47 #include "ash/wm/wm_event.h" |
48 #include "ash/wm_window.h" | 48 #include "ash/wm_window.h" |
49 #include "base/metrics/histogram_macros.h" | 49 #include "base/metrics/histogram_macros.h" |
50 #include "base/metrics/user_metrics.h" | 50 #include "base/metrics/user_metrics.h" |
51 #include "base/strings/string_split.h" | 51 #include "base/strings/string_split.h" |
52 #include "base/strings/utf_string_conversions.h" | 52 #include "base/strings/utf_string_conversions.h" |
| 53 #include "chromeos/chromeos_switches.h" |
53 #include "chromeos/dbus/dbus_thread_manager.h" | 54 #include "chromeos/dbus/dbus_thread_manager.h" |
54 #include "chromeos/dbus/power_manager_client.h" | 55 #include "chromeos/dbus/power_manager_client.h" |
| 56 #include "ui/app_list/presenter/app_list.h" |
55 #include "ui/base/accelerators/accelerator.h" | 57 #include "ui/base/accelerators/accelerator.h" |
56 #include "ui/base/accelerators/accelerator_manager.h" | 58 #include "ui/base/accelerators/accelerator_manager.h" |
57 #include "ui/base/ime/chromeos/ime_keyboard.h" | 59 #include "ui/base/ime/chromeos/ime_keyboard.h" |
58 #include "ui/base/ime/chromeos/input_method_manager.h" | 60 #include "ui/base/ime/chromeos/input_method_manager.h" |
59 #include "ui/base/l10n/l10n_util.h" | 61 #include "ui/base/l10n/l10n_util.h" |
60 #include "ui/compositor/layer.h" | 62 #include "ui/compositor/layer.h" |
61 #include "ui/compositor/layer_animation_sequence.h" | 63 #include "ui/compositor/layer_animation_sequence.h" |
62 #include "ui/compositor/layer_animator.h" | 64 #include "ui/compositor/layer_animator.h" |
63 #include "ui/gfx/paint_vector_icon.h" | 65 #include "ui/gfx/paint_vector_icon.h" |
64 #include "ui/keyboard/keyboard_controller.h" | 66 #include "ui/keyboard/keyboard_controller.h" |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
512 ->GetShelf() | 514 ->GetShelf() |
513 ->GetStatusAreaWidget() | 515 ->GetStatusAreaWidget() |
514 ->palette_tray() | 516 ->palette_tray() |
515 ->ShowPalette(); | 517 ->ShowPalette(); |
516 } | 518 } |
517 | 519 |
518 bool CanHandleShowStylusTools() { | 520 bool CanHandleShowStylusTools() { |
519 return palette_utils::ShouldShowPalette(); | 521 return palette_utils::ShouldShowPalette(); |
520 } | 522 } |
521 | 523 |
| 524 bool CanHandleStartVoiceInteraction() { |
| 525 return chromeos::switches::IsVoiceInteractionEnabled(); |
| 526 } |
| 527 |
| 528 void HandleStartVoiceInteraction() { |
| 529 Shell::Get()->app_list()->StartVoiceInteractionSession(); |
| 530 } |
| 531 |
522 void HandleSuspend() { | 532 void HandleSuspend() { |
523 base::RecordAction(UserMetricsAction("Accel_Suspend")); | 533 base::RecordAction(UserMetricsAction("Accel_Suspend")); |
524 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); | 534 chromeos::DBusThreadManager::Get()->GetPowerManagerClient()->RequestSuspend(); |
525 } | 535 } |
526 | 536 |
527 bool CanHandleCycleUser() { | 537 bool CanHandleCycleUser() { |
528 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() && | 538 return Shell::Get()->shell_delegate()->IsMultiProfilesEnabled() && |
529 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1; | 539 Shell::Get()->session_controller()->NumberOfLoggedInUsers() > 1; |
530 } | 540 } |
531 | 541 |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 case NEW_INCOGNITO_WINDOW: | 924 case NEW_INCOGNITO_WINDOW: |
915 return CanHandleNewIncognitoWindow(); | 925 return CanHandleNewIncognitoWindow(); |
916 case NEXT_IME: | 926 case NEXT_IME: |
917 return CanHandleNextIme(ime_control_delegate_.get()); | 927 return CanHandleNextIme(ime_control_delegate_.get()); |
918 case PREVIOUS_IME: | 928 case PREVIOUS_IME: |
919 return CanHandlePreviousIme(ime_control_delegate_.get()); | 929 return CanHandlePreviousIme(ime_control_delegate_.get()); |
920 case SHOW_MESSAGE_CENTER_BUBBLE: | 930 case SHOW_MESSAGE_CENTER_BUBBLE: |
921 return CanHandleShowMessageCenterBubble(); | 931 return CanHandleShowMessageCenterBubble(); |
922 case SHOW_STYLUS_TOOLS: | 932 case SHOW_STYLUS_TOOLS: |
923 return CanHandleShowStylusTools(); | 933 return CanHandleShowStylusTools(); |
| 934 case START_VOICE_INTERACTION: |
| 935 return CanHandleStartVoiceInteraction(); |
924 case SWITCH_IME: | 936 case SWITCH_IME: |
925 return CanHandleSwitchIme(ime_control_delegate_.get(), accelerator); | 937 return CanHandleSwitchIme(ime_control_delegate_.get(), accelerator); |
926 case SWITCH_TO_PREVIOUS_USER: | 938 case SWITCH_TO_PREVIOUS_USER: |
927 case SWITCH_TO_NEXT_USER: | 939 case SWITCH_TO_NEXT_USER: |
928 return CanHandleCycleUser(); | 940 return CanHandleCycleUser(); |
929 case TOGGLE_APP_LIST: | 941 case TOGGLE_APP_LIST: |
930 return CanHandleToggleAppList(accelerator, previous_accelerator); | 942 return CanHandleToggleAppList(accelerator, previous_accelerator); |
931 case TOGGLE_CAPS_LOCK: | 943 case TOGGLE_CAPS_LOCK: |
932 return CanHandleToggleCapsLock(accelerator, previous_accelerator); | 944 return CanHandleToggleCapsLock(accelerator, previous_accelerator); |
933 case WINDOW_CYCLE_SNAP_LEFT: | 945 case WINDOW_CYCLE_SNAP_LEFT: |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1150 break; | 1162 break; |
1151 case SHOW_STYLUS_TOOLS: | 1163 case SHOW_STYLUS_TOOLS: |
1152 HandleShowStylusTools(); | 1164 HandleShowStylusTools(); |
1153 break; | 1165 break; |
1154 case SHOW_SYSTEM_TRAY_BUBBLE: | 1166 case SHOW_SYSTEM_TRAY_BUBBLE: |
1155 HandleShowSystemTrayBubble(); | 1167 HandleShowSystemTrayBubble(); |
1156 break; | 1168 break; |
1157 case SHOW_TASK_MANAGER: | 1169 case SHOW_TASK_MANAGER: |
1158 HandleShowTaskManager(); | 1170 HandleShowTaskManager(); |
1159 break; | 1171 break; |
| 1172 case START_VOICE_INTERACTION: |
| 1173 HandleStartVoiceInteraction(); |
| 1174 break; |
1160 case SUSPEND: | 1175 case SUSPEND: |
1161 HandleSuspend(); | 1176 HandleSuspend(); |
1162 break; | 1177 break; |
1163 case SWITCH_IME: | 1178 case SWITCH_IME: |
1164 HandleSwitchIme(ime_control_delegate_.get(), accelerator); | 1179 HandleSwitchIme(ime_control_delegate_.get(), accelerator); |
1165 break; | 1180 break; |
1166 case SWITCH_TO_NEXT_USER: | 1181 case SWITCH_TO_NEXT_USER: |
1167 HandleCycleUser(CycleUserDirection::NEXT); | 1182 HandleCycleUser(CycleUserDirection::NEXT); |
1168 break; | 1183 break; |
1169 case SWITCH_TO_PREVIOUS_USER: | 1184 case SWITCH_TO_PREVIOUS_USER: |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1299 data->uma_histogram_name, data->notification_message_id, | 1314 data->uma_histogram_name, data->notification_message_id, |
1300 data->old_shortcut_id, data->new_shortcut_id); | 1315 data->old_shortcut_id, data->new_shortcut_id); |
1301 | 1316 |
1302 if (!data->deprecated_enabled) | 1317 if (!data->deprecated_enabled) |
1303 return AcceleratorProcessingStatus::STOP; | 1318 return AcceleratorProcessingStatus::STOP; |
1304 | 1319 |
1305 return AcceleratorProcessingStatus::PROCEED; | 1320 return AcceleratorProcessingStatus::PROCEED; |
1306 } | 1321 } |
1307 | 1322 |
1308 } // namespace ash | 1323 } // namespace ash |
OLD | NEW |