Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Side by Side Diff: ash/accelerators/accelerator_controller.cc

Issue 2808723004: Renames WmShell to ShellPort (Closed)
Patch Set: feedback Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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"
11 #include "ash/accelerators/debug_commands.h" 11 #include "ash/accelerators/debug_commands.h"
12 #include "ash/accessibility_delegate.h" 12 #include "ash/accessibility_delegate.h"
13 #include "ash/accessibility_types.h" 13 #include "ash/accessibility_types.h"
14 #include "ash/focus_cycler.h" 14 #include "ash/focus_cycler.h"
15 #include "ash/ime_control_delegate.h" 15 #include "ash/ime_control_delegate.h"
16 #include "ash/media_controller.h" 16 #include "ash/media_controller.h"
17 #include "ash/multi_profile_uma.h" 17 #include "ash/multi_profile_uma.h"
18 #include "ash/new_window_controller.h" 18 #include "ash/new_window_controller.h"
19 #include "ash/palette_delegate.h" 19 #include "ash/palette_delegate.h"
20 #include "ash/resources/vector_icons/vector_icons.h" 20 #include "ash/resources/vector_icons/vector_icons.h"
21 #include "ash/root_window_controller.h" 21 #include "ash/root_window_controller.h"
22 #include "ash/rotator/window_rotation.h" 22 #include "ash/rotator/window_rotation.h"
23 #include "ash/session/session_controller.h" 23 #include "ash/session/session_controller.h"
24 #include "ash/shelf/shelf_widget.h" 24 #include "ash/shelf/shelf_widget.h"
25 #include "ash/shelf/wm_shelf.h" 25 #include "ash/shelf/wm_shelf.h"
26 #include "ash/shell.h" 26 #include "ash/shell.h"
27 #include "ash/shell_delegate.h" 27 #include "ash/shell_delegate.h"
28 #include "ash/shell_port.h"
28 #include "ash/strings/grit/ash_strings.h" 29 #include "ash/strings/grit/ash_strings.h"
29 #include "ash/system/brightness_control_delegate.h" 30 #include "ash/system/brightness_control_delegate.h"
30 #include "ash/system/ime_menu/ime_menu_tray.h" 31 #include "ash/system/ime_menu/ime_menu_tray.h"
31 #include "ash/system/keyboard_brightness_control_delegate.h" 32 #include "ash/system/keyboard_brightness_control_delegate.h"
32 #include "ash/system/palette/palette_tray.h" 33 #include "ash/system/palette/palette_tray.h"
33 #include "ash/system/palette/palette_utils.h" 34 #include "ash/system/palette/palette_utils.h"
34 #include "ash/system/status_area_widget.h" 35 #include "ash/system/status_area_widget.h"
35 #include "ash/system/system_notifier.h" 36 #include "ash/system/system_notifier.h"
36 #include "ash/system/tray/system_tray.h" 37 #include "ash/system/tray/system_tray.h"
37 #include "ash/system/tray/system_tray_delegate.h" 38 #include "ash/system/tray/system_tray_delegate.h"
38 #include "ash/system/tray/system_tray_notifier.h" 39 #include "ash/system/tray/system_tray_notifier.h"
39 #include "ash/system/web_notification/web_notification_tray.h" 40 #include "ash/system/web_notification/web_notification_tray.h"
40 #include "ash/wm/mru_window_tracker.h" 41 #include "ash/wm/mru_window_tracker.h"
41 #include "ash/wm/overview/window_selector_controller.h" 42 #include "ash/wm/overview/window_selector_controller.h"
42 #include "ash/wm/screen_pinning_controller.h" 43 #include "ash/wm/screen_pinning_controller.h"
43 #include "ash/wm/window_cycle_controller.h" 44 #include "ash/wm/window_cycle_controller.h"
44 #include "ash/wm/window_positioning_utils.h" 45 #include "ash/wm/window_positioning_utils.h"
45 #include "ash/wm/window_state.h" 46 #include "ash/wm/window_state.h"
46 #include "ash/wm/window_util.h" 47 #include "ash/wm/window_util.h"
47 #include "ash/wm/wm_event.h" 48 #include "ash/wm/wm_event.h"
48 #include "ash/wm_shell.h"
49 #include "ash/wm_window.h" 49 #include "ash/wm_window.h"
50 #include "base/metrics/histogram_macros.h" 50 #include "base/metrics/histogram_macros.h"
51 #include "base/metrics/user_metrics.h" 51 #include "base/metrics/user_metrics.h"
52 #include "base/strings/string_split.h" 52 #include "base/strings/string_split.h"
53 #include "base/strings/utf_string_conversions.h" 53 #include "base/strings/utf_string_conversions.h"
54 #include "chromeos/dbus/dbus_thread_manager.h" 54 #include "chromeos/dbus/dbus_thread_manager.h"
55 #include "chromeos/dbus/power_manager_client.h" 55 #include "chromeos/dbus/power_manager_client.h"
56 #include "ui/base/accelerators/accelerator.h" 56 #include "ui/base/accelerators/accelerator.h"
57 #include "ui/base/accelerators/accelerator_manager.h" 57 #include "ui/base/accelerators/accelerator_manager.h"
58 #include "ui/base/ime/chromeos/ime_keyboard.h" 58 #include "ui/base/ime/chromeos/ime_keyboard.h"
(...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane")); 199 base::RecordAction(UserMetricsAction("Accel_Focus_Previous_Pane"));
200 break; 200 break;
201 } 201 }
202 } 202 }
203 Shell::Get()->focus_cycler()->RotateFocus(direction); 203 Shell::Get()->focus_cycler()->RotateFocus(direction);
204 } 204 }
205 205
206 void HandleFocusShelf() { 206 void HandleFocusShelf() {
207 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf")); 207 base::RecordAction(UserMetricsAction("Accel_Focus_Shelf"));
208 // TODO(jamescook): Should this be GetWmRootWindowForNewWindows()? 208 // TODO(jamescook): Should this be GetWmRootWindowForNewWindows()?
209 WmShelf* shelf = WmShelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow()); 209 WmShelf* shelf = WmShelf::ForWindow(ShellPort::Get()->GetPrimaryRootWindow());
210 Shell::Get()->focus_cycler()->FocusWidget(shelf->shelf_widget()); 210 Shell::Get()->focus_cycler()->FocusWidget(shelf->shelf_widget());
211 } 211 }
212 212
213 void HandleLaunchAppN(int n) { 213 void HandleLaunchAppN(int n) {
214 base::RecordAction(UserMetricsAction("Accel_Launch_App")); 214 base::RecordAction(UserMetricsAction("Accel_Launch_App"));
215 WmShelf::LaunchShelfItem(n); 215 WmShelf::LaunchShelfItem(n);
216 } 216 }
217 217
218 void HandleLaunchLastApp() { 218 void HandleLaunchLastApp() {
219 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App")); 219 base::RecordAction(UserMetricsAction("Accel_Launch_Last_App"));
(...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after
439 439
440 void HandlePositionCenter() { 440 void HandlePositionCenter() {
441 base::RecordAction(UserMetricsAction("Accel_Window_Position_Center")); 441 base::RecordAction(UserMetricsAction("Accel_Window_Position_Center"));
442 wm::CenterWindow(WmWindow::Get(wm::GetActiveWindow())); 442 wm::CenterWindow(WmWindow::Get(wm::GetActiveWindow()));
443 } 443 }
444 444
445 void HandleShowImeMenuBubble() { 445 void HandleShowImeMenuBubble() {
446 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble")); 446 base::RecordAction(UserMetricsAction("Accel_Show_Ime_Menu_Bubble"));
447 447
448 StatusAreaWidget* status_area_widget = 448 StatusAreaWidget* status_area_widget =
449 WmShelf::ForWindow(WmShell::Get()->GetPrimaryRootWindow()) 449 WmShelf::ForWindow(ShellPort::Get()->GetPrimaryRootWindow())
450 ->GetStatusAreaWidget(); 450 ->GetStatusAreaWidget();
451 if (status_area_widget) { 451 if (status_area_widget) {
452 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray(); 452 ImeMenuTray* ime_menu_tray = status_area_widget->ime_menu_tray();
453 if (ime_menu_tray && ime_menu_tray->visible() && 453 if (ime_menu_tray && ime_menu_tray->visible() &&
454 !ime_menu_tray->IsImeMenuBubbleShown()) { 454 !ime_menu_tray->IsImeMenuBubbleShown()) {
455 ime_menu_tray->ShowImeMenuBubble(); 455 ime_menu_tray->ShowImeMenuBubble();
456 } 456 }
457 } 457 }
458 } 458 }
459 459
(...skipping 778 matching lines...) Expand 10 before | Expand all | Expand 10 after
1238 if (Shell::Get()->session_controller()->IsScreenLocked() && 1238 if (Shell::Get()->session_controller()->IsScreenLocked() &&
1239 actions_allowed_at_lock_screen_.find(action) == 1239 actions_allowed_at_lock_screen_.find(action) ==
1240 actions_allowed_at_lock_screen_.end()) { 1240 actions_allowed_at_lock_screen_.end()) {
1241 return RESTRICTION_PREVENT_PROCESSING; 1241 return RESTRICTION_PREVENT_PROCESSING;
1242 } 1242 }
1243 if (Shell::Get()->shell_delegate()->IsRunningInForcedAppMode() && 1243 if (Shell::Get()->shell_delegate()->IsRunningInForcedAppMode() &&
1244 actions_allowed_in_app_mode_.find(action) == 1244 actions_allowed_in_app_mode_.find(action) ==
1245 actions_allowed_in_app_mode_.end()) { 1245 actions_allowed_in_app_mode_.end()) {
1246 return RESTRICTION_PREVENT_PROCESSING; 1246 return RESTRICTION_PREVENT_PROCESSING;
1247 } 1247 }
1248 if (WmShell::Get()->IsSystemModalWindowOpen() && 1248 if (ShellPort::Get()->IsSystemModalWindowOpen() &&
1249 actions_allowed_at_modal_window_.find(action) == 1249 actions_allowed_at_modal_window_.find(action) ==
1250 actions_allowed_at_modal_window_.end()) { 1250 actions_allowed_at_modal_window_.end()) {
1251 // Note we prevent the shortcut from propagating so it will not 1251 // Note we prevent the shortcut from propagating so it will not
1252 // be passed to the modal window. This is important for things like 1252 // be passed to the modal window. This is important for things like
1253 // Alt+Tab that would cause an undesired effect in the modal window by 1253 // Alt+Tab that would cause an undesired effect in the modal window by
1254 // cycling through its window elements. 1254 // cycling through its window elements.
1255 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; 1255 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION;
1256 } 1256 }
1257 if (Shell::Get()->mru_window_tracker()->BuildMruWindowList().empty() && 1257 if (Shell::Get()->mru_window_tracker()->BuildMruWindowList().empty() &&
1258 actions_needing_window_.find(action) != actions_needing_window_.end()) { 1258 actions_needing_window_.find(action) != actions_needing_window_.end()) {
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
1295 data->uma_histogram_name, data->notification_message_id, 1295 data->uma_histogram_name, data->notification_message_id,
1296 data->old_shortcut_id, data->new_shortcut_id); 1296 data->old_shortcut_id, data->new_shortcut_id);
1297 1297
1298 if (!data->deprecated_enabled) 1298 if (!data->deprecated_enabled)
1299 return AcceleratorProcessingStatus::STOP; 1299 return AcceleratorProcessingStatus::STOP;
1300 1300
1301 return AcceleratorProcessingStatus::PROCEED; 1301 return AcceleratorProcessingStatus::PROCEED;
1302 } 1302 }
1303 1303
1304 } // namespace ash 1304 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698