| 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 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 5 #ifndef MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 6 #define MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "mojo/public/cpp/application/application_connection.h" | 9 #include "mojo/public/cpp/application/application_connection.h" |
| 10 #include "mojo/public/cpp/application/lib/service_connector.h" | 10 #include "mojo/public/cpp/application/lib/service_connector.h" |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 class ApplicationImpl : public InterfaceImpl<Application> { | 53 class ApplicationImpl : public InterfaceImpl<Application> { |
| 54 public: | 54 public: |
| 55 ApplicationImpl(ApplicationDelegate* delegate, | 55 ApplicationImpl(ApplicationDelegate* delegate, |
| 56 ScopedMessagePipeHandle shell_handle); | 56 ScopedMessagePipeHandle shell_handle); |
| 57 ApplicationImpl(ApplicationDelegate* delegate, MojoHandle shell_handle); | 57 ApplicationImpl(ApplicationDelegate* delegate, MojoHandle shell_handle); |
| 58 virtual ~ApplicationImpl(); | 58 virtual ~ApplicationImpl(); |
| 59 | 59 |
| 60 Shell* shell() const { return shell_.get(); } | 60 Shell* shell() const { return shell_.get(); } |
| 61 | 61 |
| 62 // Returns any initial configuration arguments, passed by the Shell. | 62 // Returns any initial configuration arguments, passed by the Shell. |
| 63 const std::vector<std::string>& args() { return args_; } | 63 const std::vector<std::string>& args() const { return args_; } |
| 64 | 64 |
| 65 // Establishes a new connection to an application. Caller does not own. | 65 // Establishes a new connection to an application. Caller does not own. |
| 66 ApplicationConnection* ConnectToApplication(const String& application_url); | 66 ApplicationConnection* ConnectToApplication(const String& application_url); |
| 67 | 67 |
| 68 // Connect to application identified by |application_url| and connect to the | 68 // Connect to application identified by |application_url| and connect to the |
| 69 // service implementation of the interface identified by |Interface|. | 69 // service implementation of the interface identified by |Interface|. |
| 70 template <typename Interface> | 70 template <typename Interface> |
| 71 void ConnectToService(const std::string& application_url, | 71 void ConnectToService(const std::string& application_url, |
| 72 InterfacePtr<Interface>* ptr) { | 72 InterfacePtr<Interface>* ptr) { |
| 73 ConnectToApplication(application_url)->ConnectToService(ptr); | 73 ConnectToApplication(application_url)->ConnectToService(ptr); |
| (...skipping 29 matching lines...) Expand all Loading... |
| 103 ShellPtr shell_; | 103 ShellPtr shell_; |
| 104 ShellPtrWatcher* shell_watch_; | 104 ShellPtrWatcher* shell_watch_; |
| 105 std::vector<std::string> args_; | 105 std::vector<std::string> args_; |
| 106 | 106 |
| 107 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); | 107 MOJO_DISALLOW_COPY_AND_ASSIGN(ApplicationImpl); |
| 108 }; | 108 }; |
| 109 | 109 |
| 110 } // namespace mojo | 110 } // namespace mojo |
| 111 | 111 |
| 112 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ | 112 #endif // MOJO_PUBLIC_APPLICATION_APPLICATION_IMPL_H_ |
| OLD | NEW |