| Index: content/shell/utility/shell_content_utility_client.cc
|
| diff --git a/content/shell/utility/shell_content_utility_client.cc b/content/shell/utility/shell_content_utility_client.cc
|
| index a00bf62d54013db71208964b9a0211492947c1af..2af0813d60335c927bfe07e27c779ab400e63843 100644
|
| --- a/content/shell/utility/shell_content_utility_client.cc
|
| +++ b/content/shell/utility/shell_content_utility_client.cc
|
| @@ -5,14 +5,42 @@
|
| #include "content/shell/utility/shell_content_utility_client.h"
|
|
|
| #include <memory>
|
| +#include <utility>
|
|
|
| #include "base/bind.h"
|
| +#include "content/public/common/service_registry.h"
|
| #include "content/public/test/test_mojo_app.h"
|
| +#include "mojo/public/cpp/bindings/strong_binding.h"
|
|
|
| namespace content {
|
|
|
| namespace {
|
|
|
| +class TestMojoServiceImpl : public mojom::TestMojoService {
|
| + public:
|
| + static void Create(mojo::InterfaceRequest<mojom::TestMojoService> request) {
|
| + new TestMojoServiceImpl(std::move(request));
|
| + }
|
| +
|
| + // mojom::TestMojoService implementation:
|
| + void DoSomething(const DoSomethingCallback& callback) override {
|
| + callback.Run();
|
| + }
|
| +
|
| + void GetRequestorName(const GetRequestorNameCallback& callback) override {
|
| + NOTREACHED();
|
| + }
|
| +
|
| + private:
|
| + explicit TestMojoServiceImpl(
|
| + mojo::InterfaceRequest<mojom::TestMojoService> request)
|
| + : binding_(this, std::move(request)) {}
|
| +
|
| + mojo::StrongBinding<mojom::TestMojoService> binding_;
|
| +
|
| + DISALLOW_COPY_AND_ASSIGN(TestMojoServiceImpl);
|
| +};
|
| +
|
| std::unique_ptr<shell::ShellClient> CreateTestApp(
|
| const base::Closure& quit_closure) {
|
| return std::unique_ptr<shell::ShellClient>(new TestMojoApp);
|
| @@ -28,4 +56,9 @@ void ShellContentUtilityClient::RegisterMojoApplications(
|
| apps->insert(std::make_pair(kTestMojoAppUrl, base::Bind(&CreateTestApp)));
|
| }
|
|
|
| +void ShellContentUtilityClient::RegisterMojoServices(
|
| + ServiceRegistry* registry) {
|
| + registry->AddService(base::Bind(&TestMojoServiceImpl::Create));
|
| +}
|
| +
|
| } // namespace content
|
|
|