Index: mojo/shell/application_instance.h |
diff --git a/mojo/shell/application_instance.h b/mojo/shell/application_instance.h |
index f50ab82113bb354afb54f2e45c4fb3a4864a6e8a..22b4cb14b3342e5d0a0be98f49f2d53cbde4043c 100644 |
--- a/mojo/shell/application_instance.h |
+++ b/mojo/shell/application_instance.h |
@@ -24,11 +24,15 @@ class ApplicationManager; |
// shell's ApplicationManager. |
class ApplicationInstance : public Shell { |
public: |
+ // |requesting_content_handler_id| is the id of the content handler that |
+ // loaded this app. If the app was not loaded by a content handler the id |
+ // is kInvalidContentHandlerID. |
ApplicationInstance(ApplicationPtr application, |
ApplicationManager* manager, |
const Identity& originator_identity, |
const Identity& resolved_identity, |
const CapabilityFilter& filter, |
+ uint32_t requesting_content_handler_id, |
const base::Closure& on_application_end); |
~ApplicationInstance() override; |
@@ -40,7 +44,8 @@ class ApplicationInstance : public Shell { |
const GURL& requestor_url, |
InterfaceRequest<ServiceProvider> services, |
ServiceProviderPtr exposed_services, |
- const CapabilityFilter& filter); |
+ const CapabilityFilter& filter, |
+ const ConnectToApplicationCallback& callback); |
// Returns the set of interfaces this application instance is allowed to see |
// from an instance with |identity|. |
@@ -49,13 +54,21 @@ class ApplicationInstance : public Shell { |
Application* application() { return application_.get(); } |
const Identity& identity() const { return identity_; } |
base::Closure on_application_end() const { return on_application_end_; } |
+ void set_requesting_content_handler_id(uint32_t id) { |
+ requesting_content_handler_id_ = id; |
+ } |
+ uint32_t requesting_content_handler_id() const { |
+ return requesting_content_handler_id_; |
+ } |
private: |
// Shell implementation: |
- void ConnectToApplication(URLRequestPtr app_request, |
- InterfaceRequest<ServiceProvider> services, |
- ServiceProviderPtr exposed_services, |
- CapabilityFilterPtr filter) override; |
+ void ConnectToApplication( |
+ URLRequestPtr app_request, |
+ InterfaceRequest<ServiceProvider> services, |
+ ServiceProviderPtr exposed_services, |
+ CapabilityFilterPtr filter, |
+ const ConnectToApplicationCallback& callback) override; |
void QuitApplication() override; |
void CallAcceptConnection(ApplicationInstance* originator, |
@@ -77,6 +90,7 @@ class ApplicationInstance : public Shell { |
InterfaceRequest<ServiceProvider> services; |
ServiceProviderPtr exposed_services; |
CapabilityFilter filter; |
+ ConnectToApplicationCallback connect_callback; |
}; |
ApplicationManager* const manager_; |
@@ -84,6 +98,7 @@ class ApplicationInstance : public Shell { |
const Identity identity_; |
const CapabilityFilter filter_; |
const bool allow_any_application_; |
+ uint32_t requesting_content_handler_id_; |
base::Closure on_application_end_; |
ApplicationPtr application_; |
Binding<Shell> binding_; |