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

Unified Diff: shell/application_manager/application_manager.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/application_manager/application_loader.cc ('k') | shell/application_manager/application_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: shell/application_manager/application_manager.h
diff --git a/shell/application_manager/application_manager.h b/shell/application_manager/application_manager.h
index ab6b2f079792b2e06ba09badbe3bd11a5dfaa18a..e8858e1c2ef19d2f18d66482ec89ae73f7fad8cc 100644
--- a/shell/application_manager/application_manager.h
+++ b/shell/application_manager/application_manager.h
@@ -79,6 +79,10 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
void set_default_loader(scoped_ptr<ApplicationLoader> loader) {
default_loader_ = loader.Pass();
}
+ void set_native_application_loader(
+ scoped_ptr<NativeApplicationLoader> loader) {
+ native_application_loader_ = loader.Pass();
+ }
// Sets a Loader to be used for a specific url.
void SetLoaderForURL(scoped_ptr<ApplicationLoader> loader, const GURL& url);
// Sets a Loader to be used for a specific url scheme.
@@ -97,11 +101,6 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
void OnShellImplError(ShellImpl* shell_impl);
private:
- enum IncludeDefaultLoader {
- INCLUDE_DEFAULT_LOADER,
- DONT_INCLUDE_DEFAULT_LOADER,
- };
-
class ContentHandlerConnection;
typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap;
@@ -110,12 +109,25 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap;
typedef std::map<GURL, std::vector<std::string>> URLToArgsMap;
- void ConnectToApplicationImpl(const GURL& requested_url,
- const GURL& resolved_url,
- const GURL& requestor_url,
- InterfaceRequest<ServiceProvider> services,
- ServiceProviderPtr exposed_services,
- ApplicationLoader* loader);
+ bool ConnectToRunningApplication(const GURL& application_url,
+ const GURL& requestor_url,
+ InterfaceRequest<ServiceProvider>* services,
+ ServiceProviderPtr* exposed_services);
+
+ bool ConnectToApplicationWithLoader(
+ const GURL& requested_url,
+ const GURL& resolved_url,
+ const GURL& requestor_url,
+ InterfaceRequest<ServiceProvider>* services,
+ ServiceProviderPtr* exposed_services,
+ ApplicationLoader* loader);
+
+ InterfaceRequest<Application> RegisterShell(
+ const GURL& requested_url,
+ const GURL& resolved_url,
+ const GURL& requestor_url,
+ InterfaceRequest<ServiceProvider> services,
+ ServiceProviderPtr exposed_services);
ShellImpl* GetShellImpl(const GURL& url);
@@ -130,9 +142,8 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
URLResponsePtr url_response);
// Return the appropriate loader for |url|. This can return NULL if there is
- // no default loader configured.
- ApplicationLoader* GetLoaderForURL(const GURL& url,
- IncludeDefaultLoader fallback);
+ // no loader configured for the URL.
+ ApplicationLoader* GetLoaderForURL(const GURL& url);
// Removes a ContentHandler when it encounters an error.
void OnContentHandlerError(ContentHandlerConnection* content_handler);
@@ -142,9 +153,11 @@ class MOJO_APPLICATION_MANAGER_EXPORT ApplicationManager {
Delegate* delegate_;
// Loader management.
+ // Loaders are chosen in the order they are listed here.
URLToLoaderMap url_to_loader_;
SchemeToLoaderMap scheme_to_loader_;
scoped_ptr<ApplicationLoader> default_loader_;
+ scoped_ptr<NativeApplicationLoader> native_application_loader_;
URLToShellImplMap url_to_shell_impl_;
URLToContentHandlerMap url_to_content_handler_;
« no previous file with comments | « shell/application_manager/application_loader.cc ('k') | shell/application_manager/application_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698