Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(530)

Unified Diff: sky/viewer/sky_loader.h

Issue 1083273003: Expose some sky_viewer plumbing to allow for reuse (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « sky/viewer/content_handler_impl.cc ('k') | sky/viewer/sky_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_
« no previous file with comments | « sky/viewer/content_handler_impl.cc ('k') | sky/viewer/sky_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698