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

Side by Side 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 unified diff | Download patch
« no previous file with comments | « services/keyboard_native/keyboard_service_impl.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "mojo/public/cpp/application/application_connection.h"
6 #include "mojo/public/cpp/application/application_delegate.h"
7 #include "mojo/public/cpp/application/application_runner.h"
8 #include "mojo/public/cpp/application/interface_factory.h"
9 #include "mojo/public/cpp/bindings/interface_request.h"
10 #include "services/keyboard_native/keyboard_service_impl.h"
11
12 namespace keyboard {
13
14 class KeyboardServiceDelegate : public mojo::ApplicationDelegate,
15 public mojo::InterfaceFactory<KeyboardService> {
16 public:
17 KeyboardServiceDelegate() {}
18 ~KeyboardServiceDelegate() override {}
19
20 // ApplicationDelegate implementation.
21 bool ConfigureIncomingConnection(
22 mojo::ApplicationConnection* connection) override {
23 connection->AddService<KeyboardService>(this);
24 return true;
25 }
26
27 // InterfaceFactory<KeyboardService> implementation.
28 void Create(mojo::ApplicationConnection* connection,
29 mojo::InterfaceRequest<KeyboardService> request) override {
30 new KeyboardServiceImpl(request.Pass());
31 }
32
33 private:
34 DISALLOW_COPY_AND_ASSIGN(KeyboardServiceDelegate);
35 };
36
37 } // namespace keyboard
38
39 MojoResult MojoMain(MojoHandle application_request) {
40 mojo::ApplicationRunner runner(new keyboard::KeyboardServiceDelegate());
41 return runner.Run(application_request);
42 }
OLDNEW
« 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