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 <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" |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "ash/system/tray/system_tray_notifier.h" | 38 #include "ash/system/tray/system_tray_notifier.h" |
39 #include "ash/system/web_notification/web_notification_tray.h" | 39 #include "ash/system/web_notification/web_notification_tray.h" |
40 #include "ash/wm/mru_window_tracker.h" | 40 #include "ash/wm/mru_window_tracker.h" |
41 #include "ash/wm/overview/window_selector_controller.h" | 41 #include "ash/wm/overview/window_selector_controller.h" |
42 #include "ash/wm/screen_pinning_controller.h" | 42 #include "ash/wm/screen_pinning_controller.h" |
43 #include "ash/wm/window_cycle_controller.h" | 43 #include "ash/wm/window_cycle_controller.h" |
44 #include "ash/wm/window_positioning_utils.h" | 44 #include "ash/wm/window_positioning_utils.h" |
45 #include "ash/wm/window_state.h" | 45 #include "ash/wm/window_state.h" |
46 #include "ash/wm/window_util.h" | 46 #include "ash/wm/window_util.h" |
47 #include "ash/wm/wm_event.h" | 47 #include "ash/wm/wm_event.h" |
48 #include "ash/wm_window.h" | |
49 #include "base/metrics/histogram_macros.h" | 48 #include "base/metrics/histogram_macros.h" |
50 #include "base/metrics/user_metrics.h" | 49 #include "base/metrics/user_metrics.h" |
51 #include "base/strings/string_split.h" | 50 #include "base/strings/string_split.h" |
52 #include "base/strings/utf_string_conversions.h" | 51 #include "base/strings/utf_string_conversions.h" |
53 #include "chromeos/chromeos_switches.h" | 52 #include "chromeos/chromeos_switches.h" |
54 #include "chromeos/dbus/dbus_thread_manager.h" | 53 #include "chromeos/dbus/dbus_thread_manager.h" |
55 #include "chromeos/dbus/power_manager_client.h" | 54 #include "chromeos/dbus/power_manager_client.h" |
56 #include "ui/app_list/presenter/app_list.h" | 55 #include "ui/app_list/presenter/app_list.h" |
57 #include "ui/base/accelerators/accelerator.h" | 56 #include "ui/base/accelerators/accelerator.h" |
58 #include "ui/base/accelerators/accelerator_manager.h" | 57 #include "ui/base/accelerators/accelerator_manager.h" |
(...skipping 358 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
417 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); | 416 base::RecordAction(UserMetricsAction("Accel_Fullscreen_F4")); |
418 accelerators::ToggleFullscreen(); | 417 accelerators::ToggleFullscreen(); |
419 } | 418 } |
420 | 419 |
421 void HandleToggleOverview() { | 420 void HandleToggleOverview() { |
422 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); | 421 base::RecordAction(base::UserMetricsAction("Accel_Overview_F5")); |
423 Shell::Get()->window_selector_controller()->ToggleOverview(); | 422 Shell::Get()->window_selector_controller()->ToggleOverview(); |
424 } | 423 } |
425 | 424 |
426 bool CanHandleWindowSnap() { | 425 bool CanHandleWindowSnap() { |
427 WmWindow* active_window = WmWindow::Get(wm::GetActiveWindow()); | 426 aura::Window* active_window = wm::GetActiveWindow(); |
428 if (!active_window) | 427 if (!active_window) |
429 return false; | 428 return false; |
430 wm::WindowState* window_state = active_window->GetWindowState(); | 429 wm::WindowState* window_state = wm::GetWindowState(active_window); |
431 // Disable window snapping shortcut key for full screen window due to | 430 // Disable window snapping shortcut key for full screen window due to |
432 // http://crbug.com/135487. | 431 // http://crbug.com/135487. |
433 return (window_state && window_state->IsUserPositionable() && | 432 return (window_state && window_state->IsUserPositionable() && |
434 !window_state->IsFullscreen()); | 433 !window_state->IsFullscreen()); |
435 } | 434 } |
436 | 435 |
437 void HandleWindowSnap(AcceleratorAction action) { | 436 void HandleWindowSnap(AcceleratorAction action) { |
438 if (action == WINDOW_CYCLE_SNAP_LEFT) | 437 if (action == WINDOW_CYCLE_SNAP_LEFT) |
439 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); | 438 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Left")); |
440 else | 439 else |
441 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); | 440 base::RecordAction(UserMetricsAction("Accel_Window_Snap_Right")); |
442 | 441 |
443 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_LEFT | 442 const wm::WMEvent event(action == WINDOW_CYCLE_SNAP_LEFT |
444 ? wm::WM_EVENT_CYCLE_SNAP_LEFT | 443 ? wm::WM_EVENT_CYCLE_SNAP_LEFT |
445 : wm::WM_EVENT_CYCLE_SNAP_RIGHT); | 444 : wm::WM_EVENT_CYCLE_SNAP_RIGHT); |
446 WmWindow* active_window = WmWindow::Get(wm::GetActiveWindow()); | 445 aura::Window* active_window = wm::GetActiveWindow(); |
447 DCHECK(active_window); | 446 DCHECK(active_window); |
448 active_window->GetWindowState()->OnWMEvent(&event); | 447 wm::GetWindowState(active_window)->OnWMEvent(&event); |
449 } | 448 } |
450 | 449 |
451 void HandleWindowMinimize() { | 450 void HandleWindowMinimize() { |
452 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Minimized_Minus")); | 451 base::RecordAction(base::UserMetricsAction("Accel_Toggle_Minimized_Minus")); |
453 accelerators::ToggleMinimized(); | 452 accelerators::ToggleMinimized(); |
454 } | 453 } |
455 | 454 |
456 bool CanHandlePositionCenter() { | 455 bool CanHandlePositionCenter() { |
457 return wm::GetActiveWindow() != nullptr; | 456 return wm::GetActiveWindow() != nullptr; |
458 } | 457 } |
(...skipping 874 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1333 data->uma_histogram_name, data->notification_message_id, | 1332 data->uma_histogram_name, data->notification_message_id, |
1334 data->old_shortcut_id, data->new_shortcut_id); | 1333 data->old_shortcut_id, data->new_shortcut_id); |
1335 | 1334 |
1336 if (!data->deprecated_enabled) | 1335 if (!data->deprecated_enabled) |
1337 return AcceleratorProcessingStatus::STOP; | 1336 return AcceleratorProcessingStatus::STOP; |
1338 | 1337 |
1339 return AcceleratorProcessingStatus::PROCEED; | 1338 return AcceleratorProcessingStatus::PROCEED; |
1340 } | 1339 } |
1341 | 1340 |
1342 } // namespace ash | 1341 } // namespace ash |
OLD | NEW |