| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_delegate_aura.h" | 5 #include "ash/accelerators/accelerator_controller_delegate_aura.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <cmath> | 8 #include <cmath> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "ash/accelerators/accelerator_commands_aura.h" | 12 #include "ash/accelerators/accelerator_commands_aura.h" |
| 13 #include "ash/common/accelerators/debug_commands.h" | 13 #include "ash/common/accelerators/debug_commands.h" |
| 14 #include "ash/common/accessibility_types.h" | 14 #include "ash/common/accessibility_types.h" |
| 15 #include "ash/common/ash_switches.h" | 15 #include "ash/common/ash_switches.h" |
| 16 #include "ash/common/focus_cycler.h" | 16 #include "ash/common/focus_cycler.h" |
| 17 #include "ash/common/gpu_support.h" | 17 #include "ash/common/gpu_support.h" |
| 18 #include "ash/common/session/session_state_delegate.h" | 18 #include "ash/common/session/session_state_delegate.h" |
| 19 #include "ash/common/shelf/shelf.h" | 19 #include "ash/common/shelf/shelf.h" |
| 20 #include "ash/common/shelf/shelf_widget.h" | 20 #include "ash/common/shelf/shelf_widget.h" |
| 21 #include "ash/common/shelf/wm_shelf.h" |
| 21 #include "ash/common/shell_delegate.h" | 22 #include "ash/common/shell_delegate.h" |
| 22 #include "ash/common/shell_window_ids.h" | 23 #include "ash/common/shell_window_ids.h" |
| 23 #include "ash/common/system/status_area_widget.h" | 24 #include "ash/common/system/status_area_widget.h" |
| 24 #include "ash/common/system/system_notifier.h" | 25 #include "ash/common/system/system_notifier.h" |
| 25 #include "ash/common/system/tray/system_tray.h" | 26 #include "ash/common/system/tray/system_tray.h" |
| 26 #include "ash/common/system/web_notification/web_notification_tray.h" | 27 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 27 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 28 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 28 #include "ash/common/wm/window_state.h" | 29 #include "ash/common/wm/window_state.h" |
| 29 #include "ash/common/wm/wm_event.h" | 30 #include "ash/common/wm/wm_event.h" |
| 30 #include "ash/common/wm_shell.h" | 31 #include "ash/common/wm_shell.h" |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 } | 136 } |
| 136 | 137 |
| 137 void HandleFocusShelf() { | 138 void HandleFocusShelf() { |
| 138 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf")); | 139 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf")); |
| 139 WmShell::Get()->focus_cycler()->FocusWidget( | 140 WmShell::Get()->focus_cycler()->FocusWidget( |
| 140 Shelf::ForPrimaryDisplay()->shelf_widget()); | 141 Shelf::ForPrimaryDisplay()->shelf_widget()); |
| 141 } | 142 } |
| 142 | 143 |
| 143 void HandleLaunchAppN(int n) { | 144 void HandleLaunchAppN(int n) { |
| 144 base::RecordAction(UserMetricsAction("Accel_Launch_App")); | 145 base::RecordAction(UserMetricsAction("Accel_Launch_App")); |
| 145 Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(n); | 146 WmShelf::LaunchAppAtIndex(n); |
| 146 } | 147 } |
| 147 | 148 |
| 148 void HandleLaunchLastApp() { | 149 void HandleLaunchLastApp() { |
| 149 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); | 150 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); |
| 150 Shelf::ForPrimaryDisplay()->LaunchAppIndexAt(-1); | 151 WmShelf::LaunchAppAtIndex(-1); |
| 151 } | 152 } |
| 152 | 153 |
| 153 bool CanHandleMagnifyScreen() { | 154 bool CanHandleMagnifyScreen() { |
| 154 return Shell::GetInstance()->magnification_controller()->IsEnabled(); | 155 return Shell::GetInstance()->magnification_controller()->IsEnabled(); |
| 155 } | 156 } |
| 156 | 157 |
| 157 // Magnify the screen | 158 // Magnify the screen |
| 158 void HandleMagnifyScreen(int delta_index) { | 159 void HandleMagnifyScreen(int delta_index) { |
| 159 if (Shell::GetInstance()->magnification_controller()->IsEnabled()) { | 160 if (Shell::GetInstance()->magnification_controller()->IsEnabled()) { |
| 160 // TODO(yoshiki): Move the following logic to MagnificationController. | 161 // TODO(yoshiki): Move the following logic to MagnificationController. |
| (...skipping 484 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 message_center::NotifierId( | 646 message_center::NotifierId( |
| 646 message_center::NotifierId::SYSTEM_COMPONENT, | 647 message_center::NotifierId::SYSTEM_COMPONENT, |
| 647 system_notifier::kNotifierDeprecatedAccelerator), | 648 system_notifier::kNotifierDeprecatedAccelerator), |
| 648 message_center::RichNotificationData(), | 649 message_center::RichNotificationData(), |
| 649 new DeprecatedAcceleratorNotificationDelegate)); | 650 new DeprecatedAcceleratorNotificationDelegate)); |
| 650 message_center::MessageCenter::Get()->AddNotification( | 651 message_center::MessageCenter::Get()->AddNotification( |
| 651 std::move(notification)); | 652 std::move(notification)); |
| 652 } | 653 } |
| 653 | 654 |
| 654 } // namespace ash | 655 } // namespace ash |
| OLD | NEW |