| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 <utility> | 5 #include <utility> |
| 6 | 6 |
| 7 #include "base/macros.h" | 7 #include "base/macros.h" |
| 8 #include "base/memory/scoped_ptr.h" | 8 #include "base/memory/scoped_ptr.h" |
| 9 #include "mojo/application/content_handler_factory.h" | 9 #include "mojo/application/content_handler_factory.h" |
| 10 #include "mojo/data_pipe_utils/data_pipe_utils.h" | 10 #include "mojo/data_pipe_utils/data_pipe_utils.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 } | 30 } |
| 31 | 31 |
| 32 private: | 32 private: |
| 33 // Application: | 33 // Application: |
| 34 void Initialize(InterfaceHandle<Shell> shell, | 34 void Initialize(InterfaceHandle<Shell> shell, |
| 35 Array<String> args, | 35 Array<String> args, |
| 36 const mojo::String& url) override { | 36 const mojo::String& url) override { |
| 37 shell_ = ShellPtr::Create(std::move(shell)); | 37 shell_ = ShellPtr::Create(std::move(shell)); |
| 38 } | 38 } |
| 39 void AcceptConnection(const String& requestor_url, | 39 void AcceptConnection(const String& requestor_url, |
| 40 InterfaceRequest<ServiceProvider> services, | 40 const String& requested_url, |
| 41 InterfaceHandle<ServiceProvider> exposed_services, | 41 InterfaceRequest<ServiceProvider> services) override { |
| 42 const String& requested_url) override { | 42 shell_->ConnectToApplication(target_url_, services.Pass()); |
| 43 shell_->ConnectToApplication(target_url_, services.Pass(), nullptr); | |
| 44 } | 43 } |
| 45 void RequestQuit() override { | 44 void RequestQuit() override { |
| 46 RunLoop::current()->Quit(); | 45 RunLoop::current()->Quit(); |
| 47 } | 46 } |
| 48 | 47 |
| 49 Binding<Application> binding_; | 48 Binding<Application> binding_; |
| 50 std::string target_url_; | 49 std::string target_url_; |
| 51 ShellPtr shell_; | 50 ShellPtr shell_; |
| 52 }; | 51 }; |
| 53 | 52 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 83 }; | 82 }; |
| 84 | 83 |
| 85 } // namespace examples | 84 } // namespace examples |
| 86 } // namespace mojo | 85 } // namespace mojo |
| 87 | 86 |
| 88 MojoResult MojoMain(MojoHandle application_request) { | 87 MojoResult MojoMain(MojoHandle application_request) { |
| 89 mojo::ScopedChromiumInit init; | 88 mojo::ScopedChromiumInit init; |
| 90 mojo::examples::ForwardingContentHandler forwarding_content_handler; | 89 mojo::examples::ForwardingContentHandler forwarding_content_handler; |
| 91 return mojo::RunApplication(application_request, &forwarding_content_handler); | 90 return mojo::RunApplication(application_request, &forwarding_content_handler); |
| 92 } | 91 } |
| OLD | NEW |