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> |
11 | 11 |
12 #include "ash/accelerators/accelerator_commands.h" | 12 #include "ash/accelerators/accelerator_commands.h" |
13 #include "ash/accelerators/debug_commands.h" | 13 #include "ash/accelerators/debug_commands.h" |
14 #include "ash/common/accessibility_delegate.h" | 14 #include "ash/common/accessibility_delegate.h" |
15 #include "ash/common/accessibility_types.h" | 15 #include "ash/common/accessibility_types.h" |
16 #include "ash/common/ash_switches.h" | 16 #include "ash/common/ash_switches.h" |
17 #include "ash/common/focus_cycler.h" | 17 #include "ash/common/focus_cycler.h" |
| 18 #include "ash/common/media_delegate.h" |
18 #include "ash/common/session/session_state_delegate.h" | 19 #include "ash/common/session/session_state_delegate.h" |
19 #include "ash/common/shelf/shelf_model.h" | 20 #include "ash/common/shelf/shelf_model.h" |
20 #include "ash/common/shell_window_ids.h" | 21 #include "ash/common/shell_window_ids.h" |
21 #include "ash/common/system/system_notifier.h" | 22 #include "ash/common/system/system_notifier.h" |
22 #include "ash/common/system/tray/system_tray_delegate.h" | 23 #include "ash/common/system/tray/system_tray_delegate.h" |
23 #include "ash/common/system/tray/system_tray_notifier.h" | 24 #include "ash/common/system/tray/system_tray_notifier.h" |
24 #include "ash/common/system/volume_control_delegate.h" | 25 #include "ash/common/system/volume_control_delegate.h" |
25 #include "ash/common/system/web_notification/web_notification_tray.h" | 26 #include "ash/common/system/web_notification/web_notification_tray.h" |
26 #include "ash/common/wm/mru_window_tracker.h" | 27 #include "ash/common/wm/mru_window_tracker.h" |
27 #include "ash/common/wm/overview/window_selector_controller.h" | 28 #include "ash/common/wm/overview/window_selector_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" |
31 #include "ash/debug.h" | 32 #include "ash/debug.h" |
32 #include "ash/display/window_tree_host_manager.h" | 33 #include "ash/display/window_tree_host_manager.h" |
33 #include "ash/gpu_support.h" | 34 #include "ash/gpu_support.h" |
34 #include "ash/ime_control_delegate.h" | 35 #include "ash/ime_control_delegate.h" |
35 #include "ash/magnifier/magnification_controller.h" | 36 #include "ash/magnifier/magnification_controller.h" |
36 #include "ash/magnifier/partial_magnification_controller.h" | 37 #include "ash/magnifier/partial_magnification_controller.h" |
37 #include "ash/media_delegate.h" | |
38 #include "ash/multi_profile_uma.h" | 38 #include "ash/multi_profile_uma.h" |
39 #include "ash/new_window_delegate.h" | 39 #include "ash/new_window_delegate.h" |
40 #include "ash/root_window_controller.h" | 40 #include "ash/root_window_controller.h" |
41 #include "ash/rotator/screen_rotation_animator.h" | 41 #include "ash/rotator/screen_rotation_animator.h" |
42 #include "ash/rotator/window_rotation.h" | 42 #include "ash/rotator/window_rotation.h" |
43 #include "ash/screen_util.h" | 43 #include "ash/screen_util.h" |
44 #include "ash/screenshot_delegate.h" | 44 #include "ash/screenshot_delegate.h" |
45 #include "ash/shelf/shelf.h" | 45 #include "ash/shelf/shelf.h" |
46 #include "ash/shelf/shelf_delegate.h" | 46 #include "ash/shelf/shelf_delegate.h" |
47 #include "ash/shelf/shelf_widget.h" | 47 #include "ash/shelf/shelf_widget.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 std::pow(kMagnificationScaleFactor, new_scale_index), true); | 258 std::pow(kMagnificationScaleFactor, new_scale_index), true); |
259 } else if (Shell::GetInstance() | 259 } else if (Shell::GetInstance() |
260 ->partial_magnification_controller() | 260 ->partial_magnification_controller() |
261 ->is_enabled()) { | 261 ->is_enabled()) { |
262 float scale = delta_index > 0 ? kDefaultPartialMagnifiedScale : 1; | 262 float scale = delta_index > 0 ? kDefaultPartialMagnifiedScale : 1; |
263 Shell::GetInstance()->partial_magnification_controller()->SetScale(scale); | 263 Shell::GetInstance()->partial_magnification_controller()->SetScale(scale); |
264 } | 264 } |
265 } | 265 } |
266 | 266 |
267 void HandleMediaNextTrack() { | 267 void HandleMediaNextTrack() { |
268 Shell::GetInstance()->media_delegate()->HandleMediaNextTrack(); | 268 WmShell::Get()->media_delegate()->HandleMediaNextTrack(); |
269 } | 269 } |
270 | 270 |
271 void HandleMediaPlayPause() { | 271 void HandleMediaPlayPause() { |
272 Shell::GetInstance()->media_delegate()->HandleMediaPlayPause(); | 272 WmShell::Get()->media_delegate()->HandleMediaPlayPause(); |
273 } | 273 } |
274 | 274 |
275 void HandleMediaPrevTrack() { | 275 void HandleMediaPrevTrack() { |
276 Shell::GetInstance()->media_delegate()->HandleMediaPrevTrack(); | 276 WmShell::Get()->media_delegate()->HandleMediaPrevTrack(); |
277 } | 277 } |
278 | 278 |
279 bool CanHandleNewIncognitoWindow() { | 279 bool CanHandleNewIncognitoWindow() { |
280 return Shell::GetInstance()->delegate()->IsIncognitoAllowed(); | 280 return Shell::GetInstance()->delegate()->IsIncognitoAllowed(); |
281 } | 281 } |
282 | 282 |
283 void HandleNewIncognitoWindow() { | 283 void HandleNewIncognitoWindow() { |
284 base::RecordAction(UserMetricsAction("Accel_New_Incognito_Window")); | 284 base::RecordAction(UserMetricsAction("Accel_New_Incognito_Window")); |
285 Shell::GetInstance()->new_window_delegate()->NewWindow( | 285 Shell::GetInstance()->new_window_delegate()->NewWindow( |
286 true /* is_incognito */); | 286 true /* is_incognito */); |
(...skipping 1153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1440 } | 1440 } |
1441 | 1441 |
1442 void AcceleratorController::SetKeyboardBrightnessControlDelegate( | 1442 void AcceleratorController::SetKeyboardBrightnessControlDelegate( |
1443 std::unique_ptr<KeyboardBrightnessControlDelegate> | 1443 std::unique_ptr<KeyboardBrightnessControlDelegate> |
1444 keyboard_brightness_control_delegate) { | 1444 keyboard_brightness_control_delegate) { |
1445 keyboard_brightness_control_delegate_ = | 1445 keyboard_brightness_control_delegate_ = |
1446 std::move(keyboard_brightness_control_delegate); | 1446 std::move(keyboard_brightness_control_delegate); |
1447 } | 1447 } |
1448 | 1448 |
1449 } // namespace ash | 1449 } // namespace ash |
OLD | NEW |