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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/accelerators/accelerator_commands.h" | 9 #include "ash/common/accelerators/accelerator_commands.h" |
10 #include "ash/common/accelerators/accelerator_controller_delegate.h" | 10 #include "ash/common/accelerators/accelerator_controller_delegate.h" |
11 #include "ash/common/accelerators/debug_commands.h" | 11 #include "ash/common/accelerators/debug_commands.h" |
12 #include "ash/common/accessibility_delegate.h" | 12 #include "ash/common/accessibility_delegate.h" |
13 #include "ash/common/accessibility_types.h" | 13 #include "ash/common/accessibility_types.h" |
14 #include "ash/common/focus_cycler.h" | 14 #include "ash/common/focus_cycler.h" |
15 #include "ash/common/ime_control_delegate.h" | 15 #include "ash/common/ime_control_delegate.h" |
16 #include "ash/common/media_controller.h" | 16 #include "ash/common/media_controller.h" |
17 #include "ash/common/multi_profile_uma.h" | 17 #include "ash/common/multi_profile_uma.h" |
18 #include "ash/common/new_window_controller.h" | 18 #include "ash/common/new_window_controller.h" |
19 #include "ash/common/palette_delegate.h" | |
19 #include "ash/common/session/session_state_delegate.h" | 20 #include "ash/common/session/session_state_delegate.h" |
20 #include "ash/common/shelf/shelf_widget.h" | 21 #include "ash/common/shelf/shelf_widget.h" |
21 #include "ash/common/shelf/wm_shelf.h" | 22 #include "ash/common/shelf/wm_shelf.h" |
22 #include "ash/common/shell_delegate.h" | 23 #include "ash/common/shell_delegate.h" |
23 #include "ash/common/system/brightness_control_delegate.h" | 24 #include "ash/common/system/brightness_control_delegate.h" |
25 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" | |
26 #include "ash/common/system/chromeos/palette/palette_tray.h" | |
27 #include "ash/common/system/chromeos/palette/palette_utils.h" | |
24 #include "ash/common/system/keyboard_brightness_control_delegate.h" | 28 #include "ash/common/system/keyboard_brightness_control_delegate.h" |
25 #include "ash/common/system/status_area_widget.h" | 29 #include "ash/common/system/status_area_widget.h" |
30 #include "ash/common/system/system_notifier.h" | |
26 #include "ash/common/system/tray/system_tray_delegate.h" | 31 #include "ash/common/system/tray/system_tray_delegate.h" |
27 #include "ash/common/system/tray/system_tray_notifier.h" | 32 #include "ash/common/system/tray/system_tray_notifier.h" |
28 #include "ash/common/system/web_notification/web_notification_tray.h" | 33 #include "ash/common/system/web_notification/web_notification_tray.h" |
29 #include "ash/common/wm/mru_window_tracker.h" | 34 #include "ash/common/wm/mru_window_tracker.h" |
30 #include "ash/common/wm/overview/window_selector_controller.h" | 35 #include "ash/common/wm/overview/window_selector_controller.h" |
31 #include "ash/common/wm/window_cycle_controller.h" | 36 #include "ash/common/wm/window_cycle_controller.h" |
32 #include "ash/common/wm/window_positioning_utils.h" | 37 #include "ash/common/wm/window_positioning_utils.h" |
33 #include "ash/common/wm/window_state.h" | 38 #include "ash/common/wm/window_state.h" |
34 #include "ash/common/wm/wm_event.h" | 39 #include "ash/common/wm/wm_event.h" |
35 #include "ash/common/wm_root_window_controller.h" | |
36 #include "ash/common/wm_shell.h" | 40 #include "ash/common/wm_shell.h" |
37 #include "ash/common/wm_window.h" | 41 #include "ash/common/wm_window.h" |
42 #include "ash/resources/vector_icons/vector_icons.h" | |
43 #include "ash/root_window_controller.h" | |
38 #include "base/metrics/histogram_macros.h" | 44 #include "base/metrics/histogram_macros.h" |
39 #include "base/metrics/user_metrics.h" | 45 #include "base/metrics/user_metrics.h" |
40 #include "ui/base/accelerators/accelerator.h" | |
41 #include "ui/base/accelerators/accelerator_manager.h" | |
42 #include "ui/keyboard/keyboard_controller.h" | |
43 | |
44 #if defined(OS_CHROMEOS) | |
45 #include "ash/common/palette_delegate.h" | |
46 #include "ash/common/shelf/wm_shelf.h" | |
47 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" | |
48 #include "ash/common/system/chromeos/palette/palette_tray.h" | |
49 #include "ash/common/system/chromeos/palette/palette_utils.h" | |
50 #include "ash/common/system/status_area_widget.h" | |
51 #include "ash/common/system/system_notifier.h" | |
52 #include "ash/common/wm_root_window_controller.h" | |
53 #include "ash/common/wm_window.h" | |
54 #include "ash/resources/vector_icons/vector_icons.h" | |
55 #include "chromeos/dbus/dbus_thread_manager.h" | 46 #include "chromeos/dbus/dbus_thread_manager.h" |
56 #include "chromeos/dbus/power_manager_client.h" | 47 #include "chromeos/dbus/power_manager_client.h" |
57 #include "grit/ash_strings.h" | 48 #include "grit/ash_strings.h" |
49 #include "ui/base/accelerators/accelerator.h" | |
50 #include "ui/base/accelerators/accelerator_manager.h" | |
58 #include "ui/base/ime/chromeos/ime_keyboard.h" | 51 #include "ui/base/ime/chromeos/ime_keyboard.h" |
59 #include "ui/base/ime/chromeos/input_method_manager.h" | 52 #include "ui/base/ime/chromeos/input_method_manager.h" |
60 #include "ui/base/l10n/l10n_util.h" | 53 #include "ui/base/l10n/l10n_util.h" |
61 #include "ui/gfx/paint_vector_icon.h" | 54 #include "ui/gfx/paint_vector_icon.h" |
55 #include "ui/keyboard/keyboard_controller.h" | |
James Cook
2017/01/11 17:00:53
Thanks for cleaning up the includes.
| |
62 #include "ui/message_center/message_center.h" | 56 #include "ui/message_center/message_center.h" |
63 #endif // defined(OS_CHROMEOS) | |
64 | 57 |
65 namespace ash { | 58 namespace ash { |
66 namespace { | 59 namespace { |
67 | 60 |
68 using base::UserMetricsAction; | 61 using base::UserMetricsAction; |
69 | 62 |
70 ui::Accelerator CreateAccelerator(ui::KeyboardCode keycode, | 63 ui::Accelerator CreateAccelerator(ui::KeyboardCode keycode, |
71 int modifiers, | 64 int modifiers, |
72 bool trigger_on_press) { | 65 bool trigger_on_press) { |
73 ui::Accelerator accelerator(keycode, modifiers); | 66 ui::Accelerator accelerator(keycode, modifiers); |
(...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
416 } | 409 } |
417 | 410 |
418 void HandleLock() { | 411 void HandleLock() { |
419 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); | 412 base::RecordAction(UserMetricsAction("Accel_LockScreen_L")); |
420 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); | 413 WmShell::Get()->GetSessionStateDelegate()->LockScreen(); |
421 } | 414 } |
422 | 415 |
423 void HandleShowStylusTools() { | 416 void HandleShowStylusTools() { |
424 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); | 417 base::RecordAction(UserMetricsAction("Accel_Show_Stylus_Tools")); |
425 | 418 |
426 WmRootWindowController* root_window_controller = | 419 RootWindowController* root_window_controller = |
427 WmShell::Get()->GetRootWindowForNewWindows()->GetRootWindowController(); | 420 WmShell::Get()->GetRootWindowForNewWindows()->GetRootWindowController(); |
428 PaletteTray* palette_tray = | 421 PaletteTray* palette_tray = |
429 root_window_controller->GetShelf()->GetStatusAreaWidget()->palette_tray(); | 422 root_window_controller->GetShelf()->GetStatusAreaWidget()->palette_tray(); |
430 palette_tray->ShowPalette(); | 423 palette_tray->ShowPalette(); |
431 } | 424 } |
432 | 425 |
433 bool CanHandleShowStylusTools() { | 426 bool CanHandleShowStylusTools() { |
434 return WmShell::Get()->palette_delegate() && | 427 return WmShell::Get()->palette_delegate() && |
435 WmShell::Get()->palette_delegate()->ShouldShowPalette(); | 428 WmShell::Get()->palette_delegate()->ShouldShowPalette(); |
436 } | 429 } |
(...skipping 736 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1173 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && | 1166 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && |
1174 actions_needing_window_.find(action) != actions_needing_window_.end()) { | 1167 actions_needing_window_.find(action) != actions_needing_window_.end()) { |
1175 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( | 1168 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( |
1176 A11Y_ALERT_WINDOW_NEEDED); | 1169 A11Y_ALERT_WINDOW_NEEDED); |
1177 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1170 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
1178 } | 1171 } |
1179 return RESTRICTION_NONE; | 1172 return RESTRICTION_NONE; |
1180 } | 1173 } |
1181 | 1174 |
1182 } // namespace ash | 1175 } // namespace ash |
OLD | NEW |