OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "base/macros.h" | 5 #include "base/macros.h" |
6 #include "base/threading/sequenced_worker_pool.h" | 6 #include "base/threading/sequenced_worker_pool.h" |
7 #include "mojo/application/application_runner_chromium.h" | 7 #include "mojo/application/application_runner_chromium.h" |
8 #include "mojo/public/c/system/main.h" | 8 #include "mojo/public/c/system/main.h" |
9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
10 #include "mojo/public/cpp/application/application_delegate.h" | 10 #include "mojo/public/cpp/application/application_delegate.h" |
(...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
45 private: | 45 private: |
46 | 46 |
47 // |ApplicationDelegate| override: | 47 // |ApplicationDelegate| override: |
48 bool ConfigureIncomingConnection( | 48 bool ConfigureIncomingConnection( |
49 mojo::ApplicationConnection* connection) override { | 49 mojo::ApplicationConnection* connection) override { |
50 connection->AddService<KeyboardServiceFactory>(this); | 50 connection->AddService<KeyboardServiceFactory>(this); |
51 return true; | 51 return true; |
52 } | 52 } |
53 | 53 |
54 // |InterfaceFactory<KeyboardService>| implementation: | 54 // |InterfaceFactory<KeyboardService>| implementation: |
55 void Create( | 55 void Create(const mojo::ConnectionContext& connection_context, |
56 mojo::ApplicationConnection* connection, | 56 mojo::InterfaceRequest<KeyboardServiceFactory> request) override { |
57 mojo::InterfaceRequest<KeyboardServiceFactory> request) override { | |
58 new KeyboardServiceFactoryImpl(request.Pass()); | 57 new KeyboardServiceFactoryImpl(request.Pass()); |
59 } | 58 } |
60 | 59 |
61 private: | 60 private: |
62 | 61 |
63 DISALLOW_COPY_AND_ASSIGN(KeyboardServiceApp); | 62 DISALLOW_COPY_AND_ASSIGN(KeyboardServiceApp); |
64 }; | 63 }; |
65 | 64 |
66 } // namespace keyboard | 65 } // namespace keyboard |
67 | 66 |
68 MojoResult MojoMain(MojoHandle application_request) { | 67 MojoResult MojoMain(MojoHandle application_request) { |
69 mojo::ApplicationRunnerChromium runner( | 68 mojo::ApplicationRunnerChromium runner( |
70 new keyboard::KeyboardServiceApp()); | 69 new keyboard::KeyboardServiceApp()); |
71 return runner.Run(application_request); | 70 return runner.Run(application_request); |
72 } | 71 } |
OLD | NEW |