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

Unified 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/mus/accelerators/accelerator_controller_delegate_mus.cc
diff --git a/ash/mus/accelerators/accelerator_controller_delegate_mus.cc b/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
index 6498af4b7e02073896d46f127143dff798e7c18b..10430975a37740d10a673ccaff20be4a9f30144c 100644
--- a/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
+++ b/ash/mus/accelerators/accelerator_controller_delegate_mus.cc
@@ -5,11 +5,20 @@
#include "ash/mus/accelerators/accelerator_controller_delegate_mus.h"
#include "base/logging.h"
+#include "mash/public/interfaces/launchable.mojom.h"
namespace ash {
namespace mus {
-AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus() {}
+AcceleratorControllerDelegateMus::AcceleratorControllerDelegateMus(
+ shell::Connector* connector)
+ : connector_(connector) {
+#if !defined(OS_CHROMEOS)
+ // To avoid trybot complaining that |connector_| is not being
+ // used in non-ChromeOS.
+ connector_ = nullptr;
+#endif
+}
AcceleratorControllerDelegateMus::~AcceleratorControllerDelegateMus() {}
@@ -53,9 +62,15 @@ bool AcceleratorControllerDelegateMus::HandlesAction(AcceleratorAction action) {
case TOGGLE_MIRROR_MODE:
case TOUCH_HUD_CLEAR:
case TOUCH_HUD_MODE_CHANGE:
- case TOUCH_HUD_PROJECTION_TOGGLE:
NOTIMPLEMENTED();
return false;
+ case TOUCH_HUD_PROJECTION_TOGGLE: {
+ mash::mojom::LaunchablePtr launchable;
+ connector_->ConnectToInterface("mojo:touch_hud", &launchable);
+ launchable->Launch(mash::mojom::kWindow,
+ mash::mojom::LaunchMode::DEFAULT);
+ return true;
+ }
#endif
default:
« 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