| 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 #include <utility> | 10 #include <utility> |
| (...skipping 16 matching lines...) Expand all Loading... |
| 27 #include "ash/common/system/status_area_widget.h" | 27 #include "ash/common/system/status_area_widget.h" |
| 28 #include "ash/common/system/system_notifier.h" | 28 #include "ash/common/system/system_notifier.h" |
| 29 #include "ash/common/system/tray/system_tray.h" | 29 #include "ash/common/system/tray/system_tray.h" |
| 30 #include "ash/common/system/tray/system_tray_delegate.h" | 30 #include "ash/common/system/tray/system_tray_delegate.h" |
| 31 #include "ash/common/system/tray/system_tray_notifier.h" | 31 #include "ash/common/system/tray/system_tray_notifier.h" |
| 32 #include "ash/common/system/volume_control_delegate.h" | 32 #include "ash/common/system/volume_control_delegate.h" |
| 33 #include "ash/common/system/web_notification/web_notification_tray.h" | 33 #include "ash/common/system/web_notification/web_notification_tray.h" |
| 34 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" | 34 #include "ash/common/wm/maximize_mode/maximize_mode_controller.h" |
| 35 #include "ash/common/wm/mru_window_tracker.h" | 35 #include "ash/common/wm/mru_window_tracker.h" |
| 36 #include "ash/common/wm/overview/window_selector_controller.h" | 36 #include "ash/common/wm/overview/window_selector_controller.h" |
| 37 #include "ash/common/wm/window_cycle_controller.h" |
| 37 #include "ash/common/wm/window_state.h" | 38 #include "ash/common/wm/window_state.h" |
| 38 #include "ash/common/wm/wm_event.h" | 39 #include "ash/common/wm/wm_event.h" |
| 39 #include "ash/common/wm_shell.h" | 40 #include "ash/common/wm_shell.h" |
| 40 #include "ash/debug.h" | 41 #include "ash/debug.h" |
| 41 #include "ash/display/window_tree_host_manager.h" | 42 #include "ash/display/window_tree_host_manager.h" |
| 42 #include "ash/ime_control_delegate.h" | 43 #include "ash/ime_control_delegate.h" |
| 43 #include "ash/magnifier/magnification_controller.h" | 44 #include "ash/magnifier/magnification_controller.h" |
| 44 #include "ash/magnifier/partial_magnification_controller.h" | 45 #include "ash/magnifier/partial_magnification_controller.h" |
| 45 #include "ash/new_window_delegate.h" | 46 #include "ash/new_window_delegate.h" |
| 46 #include "ash/root_window_controller.h" | 47 #include "ash/root_window_controller.h" |
| 47 #include "ash/rotator/screen_rotation_animator.h" | 48 #include "ash/rotator/screen_rotation_animator.h" |
| 48 #include "ash/rotator/window_rotation.h" | 49 #include "ash/rotator/window_rotation.h" |
| 49 #include "ash/screen_util.h" | 50 #include "ash/screen_util.h" |
| 50 #include "ash/screenshot_delegate.h" | 51 #include "ash/screenshot_delegate.h" |
| 51 #include "ash/shelf/shelf.h" | 52 #include "ash/shelf/shelf.h" |
| 52 #include "ash/shelf/shelf_delegate.h" | 53 #include "ash/shelf/shelf_delegate.h" |
| 53 #include "ash/shelf/shelf_widget.h" | 54 #include "ash/shelf/shelf_widget.h" |
| 54 #include "ash/shell.h" | 55 #include "ash/shell.h" |
| 55 #include "ash/touch/touch_hud_debug.h" | 56 #include "ash/touch/touch_hud_debug.h" |
| 56 #include "ash/utility/screenshot_controller.h" | 57 #include "ash/utility/screenshot_controller.h" |
| 57 #include "ash/wm/power_button_controller.h" | 58 #include "ash/wm/power_button_controller.h" |
| 58 #include "ash/wm/window_cycle_controller.h" | |
| 59 #include "ash/wm/window_state_aura.h" | 59 #include "ash/wm/window_state_aura.h" |
| 60 #include "ash/wm/window_util.h" | 60 #include "ash/wm/window_util.h" |
| 61 #include "base/bind.h" | 61 #include "base/bind.h" |
| 62 #include "base/command_line.h" | 62 #include "base/command_line.h" |
| 63 #include "base/metrics/histogram_macros.h" | 63 #include "base/metrics/histogram_macros.h" |
| 64 #include "base/metrics/user_metrics.h" | 64 #include "base/metrics/user_metrics.h" |
| 65 #include "base/strings/string_split.h" | 65 #include "base/strings/string_split.h" |
| 66 #include "base/strings/utf_string_conversions.h" | 66 #include "base/strings/utf_string_conversions.h" |
| 67 #include "ui/aura/env.h" | 67 #include "ui/aura/env.h" |
| 68 #include "ui/base/accelerators/accelerator.h" | 68 #include "ui/base/accelerators/accelerator.h" |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 auto* histogram = base::LinearHistogram::FactoryGet( | 186 auto* histogram = base::LinearHistogram::FactoryGet( |
| 187 histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1, | 187 histogram_name, 1, DEPRECATED_USAGE_COUNT, DEPRECATED_USAGE_COUNT + 1, |
| 188 base::HistogramBase::kUmaTargetedHistogramFlag); | 188 base::HistogramBase::kUmaTargetedHistogramFlag); |
| 189 histogram->Add(sample); | 189 histogram->Add(sample); |
| 190 } | 190 } |
| 191 | 191 |
| 192 void HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { | 192 void HandleCycleBackwardMRU(const ui::Accelerator& accelerator) { |
| 193 if (accelerator.key_code() == ui::VKEY_TAB) | 193 if (accelerator.key_code() == ui::VKEY_TAB) |
| 194 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); | 194 base::RecordAction(base::UserMetricsAction("Accel_PrevWindow_Tab")); |
| 195 | 195 |
| 196 Shell::GetInstance()->window_cycle_controller()->HandleCycleWindow( | 196 WmShell::Get()->window_cycle_controller()->HandleCycleWindow( |
| 197 WindowCycleController::BACKWARD); | 197 WindowCycleController::BACKWARD); |
| 198 } | 198 } |
| 199 | 199 |
| 200 void HandleCycleForwardMRU(const ui::Accelerator& accelerator) { | 200 void HandleCycleForwardMRU(const ui::Accelerator& accelerator) { |
| 201 if (accelerator.key_code() == ui::VKEY_TAB) | 201 if (accelerator.key_code() == ui::VKEY_TAB) |
| 202 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); | 202 base::RecordAction(base::UserMetricsAction("Accel_NextWindow_Tab")); |
| 203 | 203 |
| 204 Shell::GetInstance()->window_cycle_controller()->HandleCycleWindow( | 204 WmShell::Get()->window_cycle_controller()->HandleCycleWindow( |
| 205 WindowCycleController::FORWARD); | 205 WindowCycleController::FORWARD); |
| 206 } | 206 } |
| 207 | 207 |
| 208 void HandleRotatePaneFocus(FocusCycler::Direction direction) { | 208 void HandleRotatePaneFocus(FocusCycler::Direction direction) { |
| 209 switch (direction) { | 209 switch (direction) { |
| 210 // TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE. | 210 // TODO(stevet): Not sure if this is the same as IDC_FOCUS_NEXT_PANE. |
| 211 case FocusCycler::FORWARD: { | 211 case FocusCycler::FORWARD: { |
| 212 base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane")); | 212 base::RecordAction(UserMetricsAction("Accel_Focus_Next_Pane")); |
| 213 break; | 213 break; |
| 214 } | 214 } |
| (...skipping 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1408 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && | 1408 if (wm_shell->mru_window_tracker()->BuildMruWindowList().empty() && |
| 1409 actions_needing_window_.find(action) != actions_needing_window_.end()) { | 1409 actions_needing_window_.find(action) != actions_needing_window_.end()) { |
| 1410 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( | 1410 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( |
| 1411 A11Y_ALERT_WINDOW_NEEDED); | 1411 A11Y_ALERT_WINDOW_NEEDED); |
| 1412 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1412 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
| 1413 } | 1413 } |
| 1414 return RESTRICTION_NONE; | 1414 return RESTRICTION_NONE; |
| 1415 } | 1415 } |
| 1416 | 1416 |
| 1417 } // namespace ash | 1417 } // namespace ash |
| OLD | NEW |