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/common/accelerators/accelerator_controller.h" | 5 #include "ash/common/accelerators/accelerator_controller.h" |
6 | 6 |
7 #include "ash/common/accelerators/accelerator_commands.h" | 7 #include "ash/common/accelerators/accelerator_commands.h" |
8 #include "ash/common/accelerators/accelerator_controller_delegate.h" | 8 #include "ash/common/accelerators/accelerator_controller_delegate.h" |
9 #include "ash/common/accelerators/debug_commands.h" | 9 #include "ash/common/accelerators/debug_commands.h" |
10 #include "ash/common/accessibility_delegate.h" | 10 #include "ash/common/accessibility_delegate.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 #include "ash/common/wm/window_cycle_controller.h" | 28 #include "ash/common/wm/window_cycle_controller.h" |
29 #include "ash/common/wm/window_positioning_utils.h" | 29 #include "ash/common/wm/window_positioning_utils.h" |
30 #include "ash/common/wm/window_state.h" | 30 #include "ash/common/wm/window_state.h" |
31 #include "ash/common/wm/wm_event.h" | 31 #include "ash/common/wm/wm_event.h" |
32 #include "ash/common/wm_root_window_controller.h" | 32 #include "ash/common/wm_root_window_controller.h" |
33 #include "ash/common/wm_shell.h" | 33 #include "ash/common/wm_shell.h" |
34 #include "ash/common/wm_window.h" | 34 #include "ash/common/wm_window.h" |
35 #include "ash/public/interfaces/new_window.mojom.h" | 35 #include "ash/public/interfaces/new_window.mojom.h" |
36 #include "base/metrics/histogram_macros.h" | 36 #include "base/metrics/histogram_macros.h" |
37 #include "base/metrics/user_metrics.h" | 37 #include "base/metrics/user_metrics.h" |
| 38 #include "content/public/common/service_names.mojom.h" |
38 #include "services/service_manager/public/cpp/connector.h" | 39 #include "services/service_manager/public/cpp/connector.h" |
39 #include "ui/base/accelerators/accelerator.h" | 40 #include "ui/base/accelerators/accelerator.h" |
40 #include "ui/base/accelerators/accelerator_manager.h" | 41 #include "ui/base/accelerators/accelerator_manager.h" |
41 #include "ui/keyboard/keyboard_controller.h" | 42 #include "ui/keyboard/keyboard_controller.h" |
42 | 43 |
43 #if defined(OS_CHROMEOS) | 44 #if defined(OS_CHROMEOS) |
44 #include "ash/common/palette_delegate.h" | 45 #include "ash/common/palette_delegate.h" |
45 #include "ash/common/shelf/wm_shelf.h" | 46 #include "ash/common/shelf/wm_shelf.h" |
46 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" | 47 #include "ash/common/system/chromeos/ime_menu/ime_menu_tray.h" |
47 #include "ash/common/system/chromeos/palette/palette_tray.h" | 48 #include "ash/common/system/chromeos/palette/palette_tray.h" |
(...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1159 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( | 1160 wm_shell->accessibility_delegate()->TriggerAccessibilityAlert( |
1160 A11Y_ALERT_WINDOW_NEEDED); | 1161 A11Y_ALERT_WINDOW_NEEDED); |
1161 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; | 1162 return RESTRICTION_PREVENT_PROCESSING_AND_PROPAGATION; |
1162 } | 1163 } |
1163 return RESTRICTION_NONE; | 1164 return RESTRICTION_NONE; |
1164 } | 1165 } |
1165 | 1166 |
1166 mojom::VolumeController* AcceleratorController::GetVolumeController() { | 1167 mojom::VolumeController* AcceleratorController::GetVolumeController() { |
1167 if (!volume_controller_ && WmShell::Get()->delegate()->GetShellConnector()) { | 1168 if (!volume_controller_ && WmShell::Get()->delegate()->GetShellConnector()) { |
1168 WmShell::Get()->delegate()->GetShellConnector()->ConnectToInterface( | 1169 WmShell::Get()->delegate()->GetShellConnector()->ConnectToInterface( |
1169 "content_browser", &volume_controller_); | 1170 content::mojom::kBrowserServiceName, &volume_controller_); |
1170 volume_controller_.set_connection_error_handler( | 1171 volume_controller_.set_connection_error_handler( |
1171 base::Bind(&AcceleratorController::OnVolumeControllerConnectionError, | 1172 base::Bind(&AcceleratorController::OnVolumeControllerConnectionError, |
1172 base::Unretained(this))); | 1173 base::Unretained(this))); |
1173 } | 1174 } |
1174 return volume_controller_.get(); | 1175 return volume_controller_.get(); |
1175 } | 1176 } |
1176 | 1177 |
1177 void AcceleratorController::OnVolumeControllerConnectionError() { | 1178 void AcceleratorController::OnVolumeControllerConnectionError() { |
1178 volume_controller_.reset(); | 1179 volume_controller_.reset(); |
1179 } | 1180 } |
1180 | 1181 |
1181 } // namespace ash | 1182 } // namespace ash |
OLD | NEW |