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

Unified Diff: mojo/ui/input_handler.cc

Issue 1556803002: Add helpers for creating UI components. (Closed) Base URL: git@github.com:domokit/mojo.git@moz-13
Patch Set: Created 4 years, 12 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
Index: mojo/ui/input_handler.cc
diff --git a/mojo/ui/input_handler.cc b/mojo/ui/input_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..7eb06f8787e97d14db16a001b016f49c273e23f0
--- /dev/null
+++ b/mojo/ui/input_handler.cc
@@ -0,0 +1,29 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "mojo/ui/input_handler.h"
+
+#include "base/logging.h"
+#include "mojo/public/cpp/application/connect.h"
+
+namespace mojo {
+namespace ui {
+
+InputHandler::InputHandler(mojo::ServiceProvider* service_provider,
+ mojo::ui::InputListener* listener)
+ : listener_binding_(listener) {
+ DCHECK(service_provider);
+ DCHECK(listener);
+
+ mojo::ConnectToService(service_provider, &connection_);
+
+ mojo::ui::InputListenerPtr listener_ptr;
+ listener_binding_.Bind(mojo::GetProxy(&listener_ptr));
+ connection_->SetListener(listener_ptr.Pass());
+}
+
+InputHandler::~InputHandler() {}
abarth 2016/01/10 23:23:39 I'd skip this class too. It's just obfuscating wh
jeffbrown 2016/01/26 07:25:15 This is about to get much more interesting (we'll
+
+} // namespace ui
+} // namespace mojo

Powered by Google App Engine
This is Rietveld 408576698