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

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: Linkage fixes. 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
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..02326ae54a0ed9ea9de34dd6d426856546267bd0
--- /dev/null
+++ b/services/keyboard_native/main.cc
@@ -0,0 +1,41 @@
+// 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());
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(KeyboardServiceDelegate);
jamesr 2015/05/11 17:50:56 for this macro to do what it wants to do it has to
+};
+
+} // namespace keyboard
+
+MojoResult MojoMain(MojoHandle application_request) {
+ mojo::ApplicationRunner runner(new keyboard::KeyboardServiceDelegate());
+ return runner.Run(application_request);
+}

Powered by Google App Engine
This is Rietveld 408576698