Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(518)

Side by Side Diff: ash/mus/accelerators/accelerator_controller_delegate_mus.cc

Issue 2296763009: mash: Fix launching touch hud app in mash mode. (Closed)
Patch Set: deps and define Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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) {
16 #if !defined(OS_CHROMEOS)
17 // To avoid trybot complaining that |connector_| is not being
18 // used in non-ChromeOS.
19 connector_ = nullptr;
20 #endif
21 }
13 22
14 AcceleratorControllerDelegateMus::~AcceleratorControllerDelegateMus() {} 23 AcceleratorControllerDelegateMus::~AcceleratorControllerDelegateMus() {}
15 24
16 bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) { 25 bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) {
17 // This is the list of actions that are not ported from aura. The actions are 26 // 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 27 // 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 28 // eventually be empty. If there are any actions that don't make sense for
20 // mus, then they should be removed from AcceleratorAction. 29 // mus, then they should be removed from AcceleratorAction.
21 // http://crbug.com/612331. 30 // http://crbug.com/612331.
22 switch (action) { 31 switch (action) {
(...skipping 23 matching lines...) Expand all
46 case DEBUG_TOGGLE_UNIFIED_DESKTOP: 55 case DEBUG_TOGGLE_UNIFIED_DESKTOP:
47 case DISABLE_GPU_WATCHDOG: 56 case DISABLE_GPU_WATCHDOG:
48 case LOCK_PRESSED: 57 case LOCK_PRESSED:
49 case LOCK_RELEASED: 58 case LOCK_RELEASED:
50 case POWER_PRESSED: 59 case POWER_PRESSED:
51 case POWER_RELEASED: 60 case POWER_RELEASED:
52 case SWAP_PRIMARY_DISPLAY: 61 case SWAP_PRIMARY_DISPLAY:
53 case TOGGLE_MIRROR_MODE: 62 case TOGGLE_MIRROR_MODE:
54 case TOUCH_HUD_CLEAR: 63 case TOUCH_HUD_CLEAR:
55 case TOUCH_HUD_MODE_CHANGE: 64 case TOUCH_HUD_MODE_CHANGE:
56 case TOUCH_HUD_PROJECTION_TOGGLE:
57 NOTIMPLEMENTED(); 65 NOTIMPLEMENTED();
58 return false; 66 return false;
67 case TOUCH_HUD_PROJECTION_TOGGLE: {
68 mash::mojom::LaunchablePtr launchable;
69 connector_->ConnectToInterface("mojo:touch_hud", &launchable);
70 launchable->Launch(mash::mojom::kWindow,
71 mash::mojom::LaunchMode::DEFAULT);
72 return true;
73 }
59 #endif 74 #endif
60 75
61 default: 76 default:
62 break; 77 break;
63 } 78 }
64 return false; 79 return false;
65 } 80 }
66 81
67 bool AcceleratorControllerDelegateMus::CanPerformAction( 82 bool AcceleratorControllerDelegateMus::CanPerformAction(
68 AcceleratorAction action, 83 AcceleratorAction action,
(...skipping 13 matching lines...) Expand all
82 const char* const notification_id, 97 const char* const notification_id,
83 int message_id, 98 int message_id,
84 int old_shortcut_id, 99 int old_shortcut_id,
85 int new_shortcut_id) { 100 int new_shortcut_id) {
86 // TODO: http://crbug.com/630316. 101 // TODO: http://crbug.com/630316.
87 NOTIMPLEMENTED(); 102 NOTIMPLEMENTED();
88 } 103 }
89 104
90 } // namespace mus 105 } // namespace mus
91 } // namespace ash 106 } // namespace ash
OLDNEW
« no previous file with comments | « ash/mus/accelerators/accelerator_controller_delegate_mus.h ('k') | ash/mus/bridge/wm_shell_mus.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698