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

Unified Diff: services/keyboard_native/main.cc

Issue 1139453002: Initial native keyboard proof of concept. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Addressed comments. Created 5 years, 7 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 | « services/keyboard_native/keyboard_service_impl.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: services/keyboard_native/main.cc
diff --git a/services/keyboard_native/main.cc b/services/keyboard_native/main.cc
new file mode 100644
index 0000000000000000000000000000000000000000..0d08e63d202da929b3b289584c00a3a832b61e05
--- /dev/null
+++ b/services/keyboard_native/main.cc
@@ -0,0 +1,42 @@
+// 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/public/cpp/application/application_connection.h"
+#include "mojo/public/cpp/application/application_delegate.h"
+#include "mojo/public/cpp/application/application_runner.h"
+#include "mojo/public/cpp/application/interface_factory.h"
+#include "mojo/public/cpp/bindings/interface_request.h"
+#include "services/keyboard_native/keyboard_service_impl.h"
+
+namespace keyboard {
+
+class KeyboardServiceDelegate : public mojo::ApplicationDelegate,
+ public mojo::InterfaceFactory<KeyboardService> {
+ public:
+ KeyboardServiceDelegate() {}
+ ~KeyboardServiceDelegate() override {}
+
+ // ApplicationDelegate implementation.
+ bool ConfigureIncomingConnection(
+ mojo::ApplicationConnection* connection) override {
+ connection->AddService<KeyboardService>(this);
+ return true;
+ }
+
+ // InterfaceFactory<KeyboardService> implementation.
+ void Create(mojo::ApplicationConnection* connection,
+ mojo::InterfaceRequest<KeyboardService> request) override {
+ new KeyboardServiceImpl(request.Pass());
+ }
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(KeyboardServiceDelegate);
+};
+
+} // namespace keyboard
+
+MojoResult MojoMain(MojoHandle application_request) {
+ mojo::ApplicationRunner runner(new keyboard::KeyboardServiceDelegate());
+ return runner.Run(application_request);
+}
« no previous file with comments | « services/keyboard_native/keyboard_service_impl.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698