| Index: sky/viewer/sky_loader.h
|
| diff --git a/sky/viewer/sky_loader.h b/sky/viewer/sky_loader.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..707ad52fb2907a475650530f264298b15a17f42a
|
| --- /dev/null
|
| +++ b/sky/viewer/sky_loader.h
|
| @@ -0,0 +1,44 @@
|
| +// Copyright 2015 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#ifndef SKY_VIEWER_SKY_LOADER_H_
|
| +#define SKY_VIEWER_SKY_LOADER_H_
|
| +
|
| +#include "mojo/public/interfaces/application/shell.mojom.h"
|
| +#include "mojo/services/content_handler/public/interfaces/content_handler.mojom.h"
|
| +#include "mojo/services/network/public/interfaces/network_service.mojom.h"
|
| +
|
| +namespace sky {
|
| +
|
| +// A class that loads Sky applications from URLs.
|
| +class SkyLoader {
|
| + public:
|
| + // |shell| must outlive this object.
|
| + // If |initial_app_to_load| is not null, it will be loaded on the first call
|
| + // to |LoadApplication()|.
|
| + SkyLoader(mojo::Shell* shell, mojo::URLResponsePtr initial_app_to_load);
|
| +
|
| + virtual ~SkyLoader();
|
| +
|
| + // Loads the application at |url|, passing it |services| and
|
| + // |exposed_services|.
|
| + void LoadApplication(mojo::InterfaceRequest<mojo::ServiceProvider> services,
|
| + mojo::ServiceProviderPtr exposed_services,
|
| + const mojo::String& url);
|
| +
|
| + private:
|
| + void OnApplicationLoaded(
|
| + mojo::URLLoaderPtr loader,
|
| + mojo::InterfaceRequest<mojo::ServiceProvider> services,
|
| + mojo::ServiceProviderPtr exposed_services,
|
| + mojo::URLResponsePtr response);
|
| +
|
| + mojo::Shell* shell_;
|
| + mojo::NetworkServicePtr network_service_;
|
| + mojo::URLResponsePtr initial_app_to_load_;
|
| +};
|
| +
|
| +} // namespace sky
|
| +
|
| +#endif // SKY_VIEWER_SKY_LOADER_H_
|
|
|