| 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 MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ | 5 #ifndef MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ |
| 6 #define MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ | 6 #define MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include <utility> |
| 9 | 10 |
| 10 #include "base/callback.h" | 11 #include "base/callback.h" |
| 11 #include "mojo/application/public/interfaces/service_provider.mojom.h" | 12 #include "mojo/application/public/interfaces/service_provider.mojom.h" |
| 12 #include "mojo/application/public/interfaces/shell.mojom.h" | 13 #include "mojo/application/public/interfaces/shell.mojom.h" |
| 13 #include "mojo/public/cpp/bindings/interface_request.h" | 14 #include "mojo/public/cpp/bindings/interface_request.h" |
| 14 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" | 15 #include "mojo/services/network/public/interfaces/url_loader.mojom.h" |
| 15 #include "mojo/shell/identity.h" | 16 #include "mojo/shell/identity.h" |
| 16 #include "url/gurl.h" | 17 #include "url/gurl.h" |
| 17 | 18 |
| 18 namespace mojo { | 19 namespace mojo { |
| (...skipping 18 matching lines...) Expand all Loading... |
| 37 void SetTargetURLRequest(URLRequestPtr request, const Identity& target); | 38 void SetTargetURLRequest(URLRequestPtr request, const Identity& target); |
| 38 | 39 |
| 39 void set_source(const Identity& source) { source_ = source; } | 40 void set_source(const Identity& source) { source_ = source; } |
| 40 const Identity& source() const { return source_; } | 41 const Identity& source() const { return source_; } |
| 41 const Identity& target() const { return target_; } | 42 const Identity& target() const { return target_; } |
| 42 | 43 |
| 43 const URLRequest* target_url_request() const { | 44 const URLRequest* target_url_request() const { |
| 44 return target_url_request_.get(); | 45 return target_url_request_.get(); |
| 45 } | 46 } |
| 46 // NOTE: This doesn't reset |target_|. | 47 // NOTE: This doesn't reset |target_|. |
| 47 URLRequestPtr TakeTargetURLRequest() { return target_url_request_.Pass(); } | 48 URLRequestPtr TakeTargetURLRequest() { |
| 49 return std::move(target_url_request_); |
| 50 } |
| 48 | 51 |
| 49 void set_services(InterfaceRequest<ServiceProvider> value) { | 52 void set_services(InterfaceRequest<ServiceProvider> value) { |
| 50 services_ = value.Pass(); | 53 services_ = std::move(value); |
| 51 } | 54 } |
| 52 InterfaceRequest<ServiceProvider> TakeServices() { return services_.Pass(); } | 55 InterfaceRequest<ServiceProvider> TakeServices() { |
| 56 return std::move(services_); |
| 57 } |
| 53 | 58 |
| 54 void set_exposed_services(ServiceProviderPtr value) { | 59 void set_exposed_services(ServiceProviderPtr value) { |
| 55 exposed_services_ = value.Pass(); | 60 exposed_services_ = std::move(value); |
| 56 } | 61 } |
| 57 ServiceProviderPtr TakeExposedServices() { return exposed_services_.Pass(); } | 62 ServiceProviderPtr TakeExposedServices() { |
| 63 return std::move(exposed_services_); |
| 64 } |
| 58 | 65 |
| 59 void set_on_application_end(const base::Closure& value) { | 66 void set_on_application_end(const base::Closure& value) { |
| 60 on_application_end_ = value; | 67 on_application_end_ = value; |
| 61 } | 68 } |
| 62 const base::Closure& on_application_end() const { | 69 const base::Closure& on_application_end() const { |
| 63 return on_application_end_; | 70 return on_application_end_; |
| 64 } | 71 } |
| 65 | 72 |
| 66 void set_connect_callback(const Shell::ConnectToApplicationCallback& value) { | 73 void set_connect_callback(const Shell::ConnectToApplicationCallback& value) { |
| 67 connect_callback_ = value; | 74 connect_callback_ = value; |
| (...skipping 18 matching lines...) Expand all Loading... |
| 86 base::Closure on_application_end_; | 93 base::Closure on_application_end_; |
| 87 Shell::ConnectToApplicationCallback connect_callback_; | 94 Shell::ConnectToApplicationCallback connect_callback_; |
| 88 | 95 |
| 89 DISALLOW_COPY_AND_ASSIGN(ConnectToApplicationParams); | 96 DISALLOW_COPY_AND_ASSIGN(ConnectToApplicationParams); |
| 90 }; | 97 }; |
| 91 | 98 |
| 92 } // namespace shell | 99 } // namespace shell |
| 93 } // namespace mojo | 100 } // namespace mojo |
| 94 | 101 |
| 95 #endif // MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ | 102 #endif // MOJO_SHELL_CONNECT_TO_APPLICATION_PARAMS_H_ |
| OLD | NEW |