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

Unified Diff: shell/application_manager/application_loader.h

Issue 930243006: Simplify the ApplicationLoader interface in preparation for changes. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: ptal Created 5 years, 10 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 | « shell/android/ui_application_loader_android.cc ('k') | shell/application_manager/application_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_loader.h
diff --git a/shell/application_manager/application_loader.h b/shell/application_manager/application_loader.h
index b081819cd80e614fd6c9994f776d9dc760121493..9e39de14dbdc647c450b0194235519697a987494 100644
--- a/shell/application_manager/application_loader.h
+++ b/shell/application_manager/application_loader.h
@@ -17,36 +17,14 @@ namespace mojo {
class Application;
class ApplicationManager;
-// Interface to allowing loading behavior to be established for schemes,
-// specific urls or as the default.
-// A ApplicationLoader is responsible to using whatever mechanism is appropriate
-// to load the application at url.
-// The handle to the shell is passed to that application so it can bind it to
-// a Shell instance. This will give the Application a way to connect to other
-// apps and services.
+// Interface to implement special application loading behavior for a particular
+// URL or scheme.
class MOJO_APPLICATION_MANAGER_EXPORT ApplicationLoader {
public:
- typedef base::Callback<void(const GURL& content_handler_url,
- InterfaceRequest<Application> application_request,
- URLResponsePtr url_request)> LoadCallback;
virtual ~ApplicationLoader() {}
- // Returns a callback that will should never be called.
- static LoadCallback SimpleLoadCallback();
-
- // Load the application named |url|. Applications can be loaded two ways:
- //
- // 1. |url| can refer directly to a Mojo application. In this case,
- // shell_handle should be used to implement the mojo.Application interface.
- //
- // 2. |url| can refer to some content that can be handled by some other Mojo
- // application. In this case, call callbacks and specify the URL of the
- // application that should handle the content. The specified application
- // must implement the mojo.ContentHandler interface.
- virtual void Load(ApplicationManager* application_manager,
- const GURL& url,
- InterfaceRequest<Application> application_request,
- LoadCallback callback) = 0;
+ virtual void Load(const GURL& url,
+ InterfaceRequest<Application> application_request) = 0;
// Called when the Application exits.
virtual void OnApplicationError(ApplicationManager* manager,
@@ -56,6 +34,26 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationLoader {
ApplicationLoader() {}
};
+// TODO(aa): Remove this temporary interface. This is just here as a stepping
+// stone, until I can tear apart NativeApplicationLoader into smaller pieces.
+// See comments at top of shell/native_application_loader.h.
+
+typedef base::Callback<void(const GURL& content_handler_url,
+ InterfaceRequest<Application> application_request,
+ URLResponsePtr url_request)> LoadCallback;
+
+class NativeApplicationLoader {
+ public:
+ // Returns a callback that should never be called.
+ static LoadCallback SimpleLoadCallback();
+
+ virtual ~NativeApplicationLoader() {}
+
+ virtual void Load(const GURL& url,
+ InterfaceRequest<Application> application_request,
+ LoadCallback callback) {}
+};
+
} // namespace mojo
#endif // SHELL_APPLICATION_MANAGER_APPLICATION_LOADER_H_
« no previous file with comments | « shell/android/ui_application_loader_android.cc ('k') | shell/application_manager/application_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698