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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
42 #include "ash/system/tray/system_tray.h" | 42 #include "ash/system/tray/system_tray.h" |
43 #include "ash/system/tray/system_tray_delegate.h" | 43 #include "ash/system/tray/system_tray_delegate.h" |
44 #include "ash/system/tray/system_tray_notifier.h" | 44 #include "ash/system/tray/system_tray_notifier.h" |
45 #include "ash/system/web_notification/web_notification_tray.h" | 45 #include "ash/system/web_notification/web_notification_tray.h" |
46 #include "ash/touch/touch_hud_debug.h" | 46 #include "ash/touch/touch_hud_debug.h" |
47 #include "ash/volume_control_delegate.h" | 47 #include "ash/volume_control_delegate.h" |
48 #include "ash/wm/mru_window_tracker.h" | 48 #include "ash/wm/mru_window_tracker.h" |
49 #include "ash/wm/overview/window_selector_controller.h" | 49 #include "ash/wm/overview/window_selector_controller.h" |
50 #include "ash/wm/partial_screenshot_view.h" | 50 #include "ash/wm/partial_screenshot_view.h" |
51 #include "ash/wm/power_button_controller.h" | 51 #include "ash/wm/power_button_controller.h" |
| 52 #include "ash/wm/window_cycle_controller.h" |
52 #include "ash/wm/window_state.h" | 53 #include "ash/wm/window_state.h" |
53 #include "ash/wm/window_util.h" | 54 #include "ash/wm/window_util.h" |
54 #include "ash/wm/wm_event.h" | 55 #include "ash/wm/wm_event.h" |
55 #include "base/bind.h" | 56 #include "base/bind.h" |
56 #include "base/command_line.h" | 57 #include "base/command_line.h" |
57 #include "base/metrics/user_metrics.h" | 58 #include "base/metrics/user_metrics.h" |
58 #include "ui/aura/env.h" | 59 #include "ui/aura/env.h" |
59 #include "ui/aura/window_event_dispatcher.h" | 60 #include "ui/aura/window_event_dispatcher.h" |
60 #include "ui/base/accelerators/accelerator.h" | 61 #include "ui/base/accelerators/accelerator.h" |
61 #include "ui/base/accelerators/accelerator_manager.h" | 62 #include "ui/base/accelerators/accelerator_manager.h" |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
120 return false; | 121 return false; |
121 | 122 |
122 focus_manager->AdvanceFocus(reverse); | 123 focus_manager->AdvanceFocus(reverse); |
123 return true; | 124 return true; |
124 } | 125 } |
125 | 126 |
126 bool HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { | 127 bool HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { |
127 if (accelerator.key_code() == ui::VKEY_TAB) | 128 if (accelerator.key_code() == ui::VKEY_TAB) |
128 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); | 129 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); |
129 | 130 |
130 Shell::GetInstance()->window_selector_controller()->HandleCycleWindow( | 131 Shell::GetInstance()->window_cycle_controller()->HandleCycleWindow( |
131 WindowSelector::BACKWARD); | 132 WindowCycleController::BACKWARD); |
132 return true; | 133 return true; |
133 } | 134 } |
134 | 135 |
135 bool HandleCycleForwardMRU(const ui::Accelerator& accelerator) { | 136 bool HandleCycleForwardMRU(const ui::Accelerator& accelerator) { |
136 if (accelerator.key_code() == ui::VKEY_TAB) | 137 if (accelerator.key_code() == ui::VKEY_TAB) |
137 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); | 138 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); |
138 | 139 |
139 Shell::GetInstance()->window_selector_controller()->HandleCycleWindow( | 140 Shell::GetInstance()->window_cycle_controller()->HandleCycleWindow( |
140 WindowSelector::FORWARD); | 141 WindowCycleController::FORWARD); |
141 return true; | 142 return true; |
142 } | 143 } |
143 | 144 |
144 bool ToggleOverview(const ui::Accelerator& accelerator) { | 145 bool ToggleOverview(const ui::Accelerator& accelerator) { |
145 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); | 146 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); |
146 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); | 147 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); |
147 return true; | 148 return true; |
148 } | 149 } |
149 | 150 |
150 bool HandleFocusLauncher() { | 151 bool HandleFocusLauncher() { |
(...skipping 1033 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1184 keyboard_brightness_control_delegate) { | 1185 keyboard_brightness_control_delegate) { |
1185 keyboard_brightness_control_delegate_ = | 1186 keyboard_brightness_control_delegate_ = |
1186 keyboard_brightness_control_delegate.Pass(); | 1187 keyboard_brightness_control_delegate.Pass(); |
1187 } | 1188 } |
1188 | 1189 |
1189 bool AcceleratorController::CanHandleAccelerators() const { | 1190 bool AcceleratorController::CanHandleAccelerators() const { |
1190 return true; | 1191 return true; |
1191 } | 1192 } |
1192 | 1193 |
1193 } // namespace ash | 1194 } // namespace ash |
OLD | NEW |