OLD | NEW |
---|---|
(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 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
| |
34 }; | |
35 | |
36 } // namespace keyboard | |
37 | |
38 MojoResult MojoMain(MojoHandle application_request) { | |
39 mojo::ApplicationRunner runner(new keyboard::KeyboardServiceDelegate()); | |
40 return runner.Run(application_request); | |
41 } | |
OLD | NEW |