| OLD | NEW |
| (Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef SKY_VIEWER_SKY_LOADER_H_ |
| 6 #define SKY_VIEWER_SKY_LOADER_H_ |
| 7 |
| 8 #include "mojo/public/interfaces/application/shell.mojom.h" |
| 9 #include "mojo/services/content_handler/public/interfaces/content_handler.mojom.
h" |
| 10 #include "mojo/services/network/public/interfaces/network_service.mojom.h" |
| 11 |
| 12 namespace sky { |
| 13 |
| 14 // A class that loads Sky applications from URLs. |
| 15 class SkyLoader { |
| 16 public: |
| 17 // |shell| must outlive this object. |
| 18 // If |initial_app_to_load| is not null, it will be loaded on the first call |
| 19 // to |LoadApplication()|. |
| 20 SkyLoader(mojo::Shell* shell, mojo::URLResponsePtr initial_app_to_load); |
| 21 |
| 22 virtual ~SkyLoader(); |
| 23 |
| 24 // Loads the application at |url|, passing it |services| and |
| 25 // |exposed_services|. |
| 26 void LoadApplication(mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 27 mojo::ServiceProviderPtr exposed_services, |
| 28 const mojo::String& url); |
| 29 |
| 30 private: |
| 31 void OnApplicationLoaded( |
| 32 mojo::URLLoaderPtr loader, |
| 33 mojo::InterfaceRequest<mojo::ServiceProvider> services, |
| 34 mojo::ServiceProviderPtr exposed_services, |
| 35 mojo::URLResponsePtr response); |
| 36 |
| 37 mojo::Shell* shell_; |
| 38 mojo::NetworkServicePtr network_service_; |
| 39 mojo::URLResponsePtr initial_app_to_load_; |
| 40 }; |
| 41 |
| 42 } // namespace sky |
| 43 |
| 44 #endif // SKY_VIEWER_SKY_LOADER_H_ |
| OLD | NEW |