| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 WindowCycleController::FORWARD); | 140 WindowCycleController::FORWARD); |
| 141 return true; | 141 return true; |
| 142 } | 142 } |
| 143 | 143 |
| 144 bool ToggleOverview(const ui::Accelerator& accelerator) { | 144 bool ToggleOverview(const ui::Accelerator& accelerator) { |
| 145 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); | 145 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); |
| 146 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); | 146 Shell::GetInstance()->window_selector_controller()->ToggleOverview(); |
| 147 return true; | 147 return true; |
| 148 } | 148 } |
| 149 | 149 |
| 150 bool HandleFocusLauncher() { | 150 bool HandleFocusShelf() { |
| 151 Shell* shell = Shell::GetInstance(); | 151 Shell* shell = Shell::GetInstance(); |
| 152 base::RecordAction(base::UserMetricsAction("Accel_Focus_Launcher")); | 152 base::RecordAction(base::UserMetricsAction("Accel_Focus_Shelf")); |
| 153 return shell->focus_cycler()->FocusWidget( | 153 return shell->focus_cycler()->FocusWidget( |
| 154 Shelf::ForPrimaryDisplay()->shelf_widget()); | 154 Shelf::ForPrimaryDisplay()->shelf_widget()); |
| 155 } | 155 } |
| 156 | 156 |
| 157 bool HandleLaunchAppN(int n) { | 157 bool HandleLaunchAppN(int n) { |
| 158 base::RecordAction(UserMetricsAction("Accel_Launch_App")); | 158 base::RecordAction(UserMetricsAction("Accel_Launch_App")); |
| 159 Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(n); | 159 Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(n); |
| 160 return true; | 160 return true; |
| 161 } | 161 } |
| 162 | 162 |
| (...skipping 821 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 984 case VOLUME_DOWN: { | 984 case VOLUME_DOWN: { |
| 985 ash::VolumeControlDelegate* volume_delegate = | 985 ash::VolumeControlDelegate* volume_delegate = |
| 986 shell->system_tray_delegate()->GetVolumeControlDelegate(); | 986 shell->system_tray_delegate()->GetVolumeControlDelegate(); |
| 987 return volume_delegate && volume_delegate->HandleVolumeDown(accelerator); | 987 return volume_delegate && volume_delegate->HandleVolumeDown(accelerator); |
| 988 } | 988 } |
| 989 case VOLUME_UP: { | 989 case VOLUME_UP: { |
| 990 ash::VolumeControlDelegate* volume_delegate = | 990 ash::VolumeControlDelegate* volume_delegate = |
| 991 shell->system_tray_delegate()->GetVolumeControlDelegate(); | 991 shell->system_tray_delegate()->GetVolumeControlDelegate(); |
| 992 return volume_delegate && volume_delegate->HandleVolumeUp(accelerator); | 992 return volume_delegate && volume_delegate->HandleVolumeUp(accelerator); |
| 993 } | 993 } |
| 994 case FOCUS_LAUNCHER: | 994 case FOCUS_SHELF: |
| 995 return HandleFocusLauncher(); | 995 return HandleFocusShelf(); |
| 996 case FOCUS_NEXT_PANE: | 996 case FOCUS_NEXT_PANE: |
| 997 return HandleRotatePaneFocus(Shell::FORWARD); | 997 return HandleRotatePaneFocus(Shell::FORWARD); |
| 998 case FOCUS_PREVIOUS_PANE: | 998 case FOCUS_PREVIOUS_PANE: |
| 999 return HandleRotatePaneFocus(Shell::BACKWARD); | 999 return HandleRotatePaneFocus(Shell::BACKWARD); |
| 1000 case SHOW_KEYBOARD_OVERLAY: | 1000 case SHOW_KEYBOARD_OVERLAY: |
| 1001 return HandleShowKeyboardOverlay(); | 1001 return HandleShowKeyboardOverlay(); |
| 1002 case SHOW_SYSTEM_TRAY_BUBBLE: | 1002 case SHOW_SYSTEM_TRAY_BUBBLE: |
| 1003 return HandleShowSystemTrayBubble(); | 1003 return HandleShowSystemTrayBubble(); |
| 1004 case SHOW_MESSAGE_CENTER_BUBBLE: | 1004 case SHOW_MESSAGE_CENTER_BUBBLE: |
| 1005 HandleShowMessageCenterBubble(); | 1005 HandleShowMessageCenterBubble(); |
| (...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1202 keyboard_brightness_control_delegate) { | 1202 keyboard_brightness_control_delegate) { |
| 1203 keyboard_brightness_control_delegate_ = | 1203 keyboard_brightness_control_delegate_ = |
| 1204 keyboard_brightness_control_delegate.Pass(); | 1204 keyboard_brightness_control_delegate.Pass(); |
| 1205 } | 1205 } |
| 1206 | 1206 |
| 1207 bool AcceleratorController::CanHandleAccelerators() const { | 1207 bool AcceleratorController::CanHandleAccelerators() const { |
| 1208 return true; | 1208 return true; |
| 1209 } | 1209 } |
| 1210 | 1210 |
| 1211 } // namespace ash | 1211 } // namespace ash |
| OLD | NEW |