Chromium Code Reviews| 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 "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "mash/public/interfaces/launchable.mojom.h" | |
| 8 | 9 |
| 9 namespace ash { | 10 namespace ash { |
| 10 namespace mus { | 11 namespace mus { |
| 11 | 12 |
| 12 AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus() {} | 13 AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus( |
| 14 shell::Connector* connector) | |
| 15 : connector_(connector) {} | |
| 13 | 16 |
| 14 AcceleratorControllerDelegateMus::~AcceleratorControllerDelegateMus() {} | 17 AcceleratorControllerDelegateMus::~AcceleratorControllerDelegateMus() {} |
| 15 | 18 |
| 16 bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) { | 19 bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) { |
| 17 // This is the list of actions that are not ported from aura. The actions are | 20 // This is the list of actions that are not ported from aura. The actions are |
| 18 // replicated here to make sure we don't forget any. This list should | 21 // replicated here to make sure we don't forget any. This list should |
| 19 // eventually be empty. If there are any actions that don't make sense for | 22 // eventually be empty. If there are any actions that don't make sense for |
| 20 // mus, then they should be removed from AcceleratorAction. | 23 // mus, then they should be removed from AcceleratorAction. |
| 21 // http://crbug.com/612331. | 24 // http://crbug.com/612331. |
| 22 switch (action) { | 25 switch (action) { |
| (...skipping 23 matching lines...) Expand all Loading... | |
| 46 case DEBUG_TOGGLE_UNIFIED_DESKTOP: | 49 case DEBUG_TOGGLE_UNIFIED_DESKTOP: |
| 47 case DISABLE_GPU_WATCHDOG: | 50 case DISABLE_GPU_WATCHDOG: |
| 48 case LOCK_PRESSED: | 51 case LOCK_PRESSED: |
| 49 case LOCK_RELEASED: | 52 case LOCK_RELEASED: |
| 50 case POWER_PRESSED: | 53 case POWER_PRESSED: |
| 51 case POWER_RELEASED: | 54 case POWER_RELEASED: |
| 52 case SWAP_PRIMARY_DISPLAY: | 55 case SWAP_PRIMARY_DISPLAY: |
| 53 case TOGGLE_MIRROR_MODE: | 56 case TOGGLE_MIRROR_MODE: |
| 54 case TOUCH_HUD_CLEAR: | 57 case TOUCH_HUD_CLEAR: |
| 55 case TOUCH_HUD_MODE_CHANGE: | 58 case TOUCH_HUD_MODE_CHANGE: |
| 56 case TOUCH_HUD_PROJECTION_TOGGLE: | |
| 57 NOTIMPLEMENTED(); | 59 NOTIMPLEMENTED(); |
| 58 return false; | 60 return false; |
| 61 case TOUCH_HUD_PROJECTION_TOGGLE: { | |
| 62 mash::mojom::LaunchablePtr launchable; | |
| 63 connector_->ConnectToInterface("mojo:touch_hud", &launchable); | |
|
sadrul
2016/09/02 00:52:28
You should add touch_hud as a data_dep for ash/mus
riajiang
2016/09/02 18:18:38
Done.
| |
| 64 launchable->Launch(mash::mojom::kWindow, | |
| 65 mash::mojom::LaunchMode::DEFAULT); | |
| 66 return true; | |
| 67 } | |
| 59 #endif | 68 #endif |
| 60 | 69 |
| 61 default: | 70 default: |
| 62 break; | 71 break; |
| 63 } | 72 } |
| 64 return false; | 73 return false; |
| 65 } | 74 } |
| 66 | 75 |
| 67 bool AcceleratorControllerDelegateMus::CanPerformAction( | 76 bool AcceleratorControllerDelegateMus::CanPerformAction( |
| 68 AcceleratorAction action, | 77 AcceleratorAction action, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 82 const char* const notification_id, | 91 const char* const notification_id, |
| 83 int message_id, | 92 int message_id, |
| 84 int old_shortcut_id, | 93 int old_shortcut_id, |
| 85 int new_shortcut_id) { | 94 int new_shortcut_id) { |
| 86 // TODO: http://crbug.com/630316. | 95 // TODO: http://crbug.com/630316. |
| 87 NOTIMPLEMENTED(); | 96 NOTIMPLEMENTED(); |
| 88 } | 97 } |
| 89 | 98 |
| 90 } // namespace mus | 99 } // namespace mus |
| 91 } // namespace ash | 100 } // namespace ash |
| OLD | NEW |