| 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 #ifndef CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ | 5 #ifndef CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ |
| 6 #define CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ | 6 #define CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/test/test_mojo_service.mojom.h" | 9 #include "content/public/test/test_mojo_service.mojom.h" |
| 10 #include "mojo/public/cpp/bindings/binding.h" | 10 #include "mojo/public/cpp/bindings/binding.h" |
| 11 #include "mojo/shell/public/cpp/interface_factory.h" | 11 #include "mojo/shell/public/cpp/interface_factory.h" |
| 12 #include "mojo/shell/public/cpp/shell_client.h" | 12 #include "mojo/shell/public/cpp/shell_client.h" |
| 13 | 13 |
| 14 namespace content { | 14 namespace content { |
| 15 | 15 |
| 16 extern const char kTestMojoAppUrl[]; | 16 extern const char kTestMojoAppUrl[]; |
| 17 | 17 |
| 18 // Simple Mojo app which provides a TestMojoService impl. The app terminates | 18 // Simple Mojo app which provides a mojom::TestMojoService impl. The app |
| 19 // itself after its TestService fulfills a single DoSomething call. | 19 // terminates itself after its TestService fulfills a single DoSomething call. |
| 20 class TestMojoApp : public mojo::ShellClient, | 20 class TestMojoApp : public mojo::ShellClient, |
| 21 public mojo::InterfaceFactory<TestMojoService>, | 21 public mojo::InterfaceFactory<mojom::TestMojoService>, |
| 22 public TestMojoService { | 22 public mojom::TestMojoService { |
| 23 public: | 23 public: |
| 24 TestMojoApp(); | 24 TestMojoApp(); |
| 25 ~TestMojoApp() override; | 25 ~TestMojoApp() override; |
| 26 | 26 |
| 27 private: | 27 private: |
| 28 // mojo::ShellClient: | 28 // mojo::ShellClient: |
| 29 bool AcceptConnection(mojo::Connection* connection) override; | 29 bool AcceptConnection(mojo::Connection* connection) override; |
| 30 | 30 |
| 31 // mojo::InterfaceFactory<TestMojoService>: | 31 // mojo::InterfaceFactory<mojom::TestMojoService>: |
| 32 void Create(mojo::Connection* connection, | 32 void Create(mojo::Connection* connection, |
| 33 mojo::InterfaceRequest<TestMojoService> request) override; | 33 mojo::InterfaceRequest<mojom::TestMojoService> request) override; |
| 34 | 34 |
| 35 // TestMojoService: | 35 // TestMojoService: |
| 36 void DoSomething(const DoSomethingCallback& callback) override; | 36 void DoSomething(const DoSomethingCallback& callback) override; |
| 37 void GetRequestorName(const GetRequestorNameCallback& callback) override; | 37 void GetRequestorName(const GetRequestorNameCallback& callback) override; |
| 38 | 38 |
| 39 mojo::Binding<TestMojoService> service_binding_; | 39 mojo::Binding<mojom::TestMojoService> service_binding_; |
| 40 | 40 |
| 41 // The name of the app connecting to us. | 41 // The name of the app connecting to us. |
| 42 std::string requestor_name_; | 42 std::string requestor_name_; |
| 43 | 43 |
| 44 DISALLOW_COPY_AND_ASSIGN(TestMojoApp); | 44 DISALLOW_COPY_AND_ASSIGN(TestMojoApp); |
| 45 }; | 45 }; |
| 46 | 46 |
| 47 } // namespace | 47 } // namespace |
| 48 | 48 |
| 49 #endif // CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ | 49 #endif // CONTENT_PUBLIC_TEST_TEST_MOJO_APP_H_ |
| OLD | NEW |