| 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" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 window_manager_->GetDisplayController()->ResetInternalDisplayZoom(); | 122 window_manager_->GetDisplayController()->ResetInternalDisplayZoom(); |
| 123 break; | 123 break; |
| 124 } | 124 } |
| 125 case SCALE_UI_UP: { | 125 case SCALE_UI_UP: { |
| 126 window_manager_->GetDisplayController()->IncreaseInternalDisplayZoom(); | 126 window_manager_->GetDisplayController()->IncreaseInternalDisplayZoom(); |
| 127 break; | 127 break; |
| 128 } | 128 } |
| 129 #if defined(OS_CHROMEOS) | 129 #if defined(OS_CHROMEOS) |
| 130 case DEV_ADD_REMOVE_DISPLAY: { | 130 case DEV_ADD_REMOVE_DISPLAY: { |
| 131 display::mojom::TestDisplayControllerPtr test_display_controller; | 131 display::mojom::TestDisplayControllerPtr test_display_controller; |
| 132 window_manager_->connector()->ConnectToInterface( | 132 window_manager_->connector()->BindInterface(ui::mojom::kServiceName, |
| 133 ui::mojom::kServiceName, &test_display_controller); | 133 &test_display_controller); |
| 134 test_display_controller->ToggleAddRemoveDisplay(); | 134 test_display_controller->ToggleAddRemoveDisplay(); |
| 135 break; | 135 break; |
| 136 } | 136 } |
| 137 case DEV_TOGGLE_UNIFIED_DESKTOP: { | 137 case DEV_TOGGLE_UNIFIED_DESKTOP: { |
| 138 // TODO(crbug.com/657816): This is hack. I'm just stealing the shortcut | 138 // TODO(crbug.com/657816): This is hack. I'm just stealing the shortcut |
| 139 // key to toggle display size in mus. This should be removed by launch. | 139 // key to toggle display size in mus. This should be removed by launch. |
| 140 display::mojom::TestDisplayControllerPtr test_display_controller; | 140 display::mojom::TestDisplayControllerPtr test_display_controller; |
| 141 window_manager_->connector()->ConnectToInterface( | 141 window_manager_->connector()->BindInterface(ui::mojom::kServiceName, |
| 142 ui::mojom::kServiceName, &test_display_controller); | 142 &test_display_controller); |
| 143 test_display_controller->ToggleDisplayResolution(); | 143 test_display_controller->ToggleDisplayResolution(); |
| 144 break; | 144 break; |
| 145 } | 145 } |
| 146 case SWAP_PRIMARY_DISPLAY: { | 146 case SWAP_PRIMARY_DISPLAY: { |
| 147 window_manager_->GetDisplayController()->SwapPrimaryDisplay(); | 147 window_manager_->GetDisplayController()->SwapPrimaryDisplay(); |
| 148 break; | 148 break; |
| 149 } | 149 } |
| 150 case TOGGLE_MIRROR_MODE: { | 150 case TOGGLE_MIRROR_MODE: { |
| 151 window_manager_->GetDisplayController()->ToggleMirrorMode(); | 151 window_manager_->GetDisplayController()->ToggleMirrorMode(); |
| 152 break; | 152 break; |
| 153 } | 153 } |
| 154 case TOUCH_HUD_PROJECTION_TOGGLE: { | 154 case TOUCH_HUD_PROJECTION_TOGGLE: { |
| 155 mash::mojom::LaunchablePtr launchable; | 155 mash::mojom::LaunchablePtr launchable; |
| 156 window_manager_->connector()->ConnectToInterface("touch_hud", | 156 window_manager_->connector()->BindInterface("touch_hud", &launchable); |
| 157 &launchable); | |
| 158 launchable->Launch(mash::mojom::kWindow, | 157 launchable->Launch(mash::mojom::kWindow, |
| 159 mash::mojom::LaunchMode::DEFAULT); | 158 mash::mojom::LaunchMode::DEFAULT); |
| 160 break; | 159 break; |
| 161 } | 160 } |
| 162 #endif | 161 #endif |
| 163 default: | 162 default: |
| 164 NOTREACHED(); | 163 NOTREACHED(); |
| 165 } | 164 } |
| 166 } | 165 } |
| 167 | 166 |
| 168 void AcceleratorControllerDelegateMus::ShowDeprecatedAcceleratorNotification( | 167 void AcceleratorControllerDelegateMus::ShowDeprecatedAcceleratorNotification( |
| 169 const char* const notification_id, | 168 const char* const notification_id, |
| 170 int message_id, | 169 int message_id, |
| 171 int old_shortcut_id, | 170 int old_shortcut_id, |
| 172 int new_shortcut_id) { | 171 int new_shortcut_id) { |
| 173 // TODO: http://crbug.com/630316. | 172 // TODO: http://crbug.com/630316. |
| 174 NOTIMPLEMENTED(); | 173 NOTIMPLEMENTED(); |
| 175 } | 174 } |
| 176 | 175 |
| 177 } // namespace mus | 176 } // namespace mus |
| 178 } // namespace ash | 177 } // namespace ash |
| OLD | NEW |