| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/mus/accelerators/accelerator_controller_delegate_mus.h" | 5 #include "ash/mus/accelerators/accelerator_controller_delegate_mus.h" |
| 6 | 6 |
| 7 #include "ash/mus/window_manager.h" | 7 #include "ash/mus/window_manager.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "mash/public/interfaces/launchable.mojom.h" | 9 #include "mash/public/interfaces/launchable.mojom.h" |
| 10 #include "services/service_manager/public/cpp/connector.h" | 10 #include "services/service_manager/public/cpp/connector.h" |
| 11 #include "services/ui/public/interfaces/constants.mojom.h" |
| 11 #include "services/ui/public/interfaces/display/display_controller.mojom.h" | 12 #include "services/ui/public/interfaces/display/display_controller.mojom.h" |
| 12 #include "services/ui/public/interfaces/display/test_display_controller.mojom.h" | 13 #include "services/ui/public/interfaces/display/test_display_controller.mojom.h" |
| 13 | 14 |
| 14 namespace ash { | 15 namespace ash { |
| 15 namespace mus { | 16 namespace mus { |
| 16 | 17 |
| 17 AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus( | 18 AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus( |
| 18 WindowManager* window_manager) | 19 WindowManager* window_manager) |
| 19 : window_manager_(window_manager) { | 20 : window_manager_(window_manager) { |
| 20 #if !defined(OS_CHROMEOS) | 21 #if !defined(OS_CHROMEOS) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 } | 96 } |
| 96 | 97 |
| 97 void AcceleratorControllerDelegateMus::PerformAction( | 98 void AcceleratorControllerDelegateMus::PerformAction( |
| 98 AcceleratorAction action, | 99 AcceleratorAction action, |
| 99 const ui::Accelerator& accelerator) { | 100 const ui::Accelerator& accelerator) { |
| 100 #if defined(OS_CHROMEOS) | 101 #if defined(OS_CHROMEOS) |
| 101 switch (action) { | 102 switch (action) { |
| 102 case DEV_ADD_REMOVE_DISPLAY: { | 103 case DEV_ADD_REMOVE_DISPLAY: { |
| 103 display::mojom::TestDisplayControllerPtr test_display_controller; | 104 display::mojom::TestDisplayControllerPtr test_display_controller; |
| 104 window_manager_->connector()->ConnectToInterface( | 105 window_manager_->connector()->ConnectToInterface( |
| 105 "ui", &test_display_controller); | 106 ui::mojom::kServiceName, &test_display_controller); |
| 106 test_display_controller->ToggleAddRemoveDisplay(); | 107 test_display_controller->ToggleAddRemoveDisplay(); |
| 107 break; | 108 break; |
| 108 } | 109 } |
| 109 case DEV_TOGGLE_UNIFIED_DESKTOP: { | 110 case DEV_TOGGLE_UNIFIED_DESKTOP: { |
| 110 // TODO(crbug.com/657816): This is hack. I'm just stealing the shortcut | 111 // TODO(crbug.com/657816): This is hack. I'm just stealing the shortcut |
| 111 // key to toggle display size in mus. This should be removed by launch. | 112 // key to toggle display size in mus. This should be removed by launch. |
| 112 display::mojom::TestDisplayControllerPtr test_display_controller; | 113 display::mojom::TestDisplayControllerPtr test_display_controller; |
| 113 window_manager_->connector()->ConnectToInterface( | 114 window_manager_->connector()->ConnectToInterface( |
| 114 "ui", &test_display_controller); | 115 ui::mojom::kServiceName, &test_display_controller); |
| 115 test_display_controller->ToggleDisplayResolution(); | 116 test_display_controller->ToggleDisplayResolution(); |
| 116 break; | 117 break; |
| 117 } | 118 } |
| 118 case SWAP_PRIMARY_DISPLAY: { | 119 case SWAP_PRIMARY_DISPLAY: { |
| 119 window_manager_->GetDisplayController()->SwapPrimaryDisplay(); | 120 window_manager_->GetDisplayController()->SwapPrimaryDisplay(); |
| 120 break; | 121 break; |
| 121 } | 122 } |
| 122 case TOUCH_HUD_PROJECTION_TOGGLE: { | 123 case TOUCH_HUD_PROJECTION_TOGGLE: { |
| 123 mash::mojom::LaunchablePtr launchable; | 124 mash::mojom::LaunchablePtr launchable; |
| 124 window_manager_->connector()->ConnectToInterface("touch_hud", | 125 window_manager_->connector()->ConnectToInterface("touch_hud", |
| (...skipping 14 matching lines...) Expand all Loading... |
| 139 const char* const notification_id, | 140 const char* const notification_id, |
| 140 int message_id, | 141 int message_id, |
| 141 int old_shortcut_id, | 142 int old_shortcut_id, |
| 142 int new_shortcut_id) { | 143 int new_shortcut_id) { |
| 143 // TODO: http://crbug.com/630316. | 144 // TODO: http://crbug.com/630316. |
| 144 NOTIMPLEMENTED(); | 145 NOTIMPLEMENTED(); |
| 145 } | 146 } |
| 146 | 147 |
| 147 } // namespace mus | 148 } // namespace mus |
| 148 } // namespace ash | 149 } // namespace ash |
| OLD | NEW |