OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 5 #ifndef MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
6 #define MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 6 #define MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <set> | 9 #include <set> |
10 | 10 |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
102 // and have a chance to shutdown. | 102 // and have a chance to shutdown. |
103 void TerminateShellConnections(); | 103 void TerminateShellConnections(); |
104 | 104 |
105 private: | 105 private: |
106 enum IncludeDefaultLoader { | 106 enum IncludeDefaultLoader { |
107 INCLUDE_DEFAULT_LOADER, | 107 INCLUDE_DEFAULT_LOADER, |
108 DONT_INCLUDE_DEFAULT_LOADER, | 108 DONT_INCLUDE_DEFAULT_LOADER, |
109 }; | 109 }; |
110 | 110 |
111 class ContentHandlerConnection; | 111 class ContentHandlerConnection; |
112 class LoadCallbacksImpl; | |
113 class ShellImpl; | 112 class ShellImpl; |
114 | 113 |
115 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap; | 114 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap; |
116 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap; | 115 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap; |
117 typedef std::map<GURL, ShellImpl*> URLToShellImplMap; | 116 typedef std::map<GURL, ShellImpl*> URLToShellImplMap; |
118 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap; | 117 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap; |
119 typedef std::map<GURL, std::vector<std::string> > URLToArgsMap; | 118 typedef std::map<GURL, std::vector<std::string> > URLToArgsMap; |
120 | 119 |
121 void ConnectToApplicationImpl(const GURL& url, | 120 void ConnectToApplicationImpl(const GURL& url, |
122 const GURL& original_url, | 121 const GURL& original_url, |
123 const GURL& requestor_url, | 122 const GURL& requestor_url, |
124 ServiceProviderPtr service_provider, | 123 ServiceProviderPtr service_provider, |
125 ApplicationLoader* loader); | 124 ApplicationLoader* loader); |
126 | 125 |
127 void ConnectToClient(ShellImpl* shell_impl, | 126 void ConnectToClient(ShellImpl* shell_impl, |
128 const GURL& url, | 127 const GURL& url, |
129 const GURL& requestor_url, | 128 const GURL& requestor_url, |
130 ServiceProviderPtr service_provider); | 129 ServiceProviderPtr service_provider); |
131 | 130 |
132 void RegisterLoadedApplication(const GURL& requested_url, | 131 void LoadWithContentHandler(const GURL& content_handler_url, |
133 const GURL& resolved_url, | 132 ScopedMessagePipeHandle shell_handle, |
134 const GURL& requestor_url, | 133 URLResponsePtr url_response); |
135 ServiceProviderPtr service_provider, | |
136 ScopedMessagePipeHandle* shell_handle); | |
137 | |
138 void LoadWithContentHandler(const GURL& requested_url, | |
139 const GURL& resolved_url, | |
140 const GURL& requestor_url, | |
141 const GURL& content_handler_url, | |
142 URLResponsePtr url_response, | |
143 ServiceProviderPtr service_provider); | |
144 | 134 |
145 // Return the appropriate loader for |url|. This can return NULL if there is | 135 // Return the appropriate loader for |url|. This can return NULL if there is |
146 // no default loader configured. | 136 // no default loader configured. |
147 ApplicationLoader* GetLoaderForURL(const GURL& url, | 137 ApplicationLoader* GetLoaderForURL(const GURL& url, |
148 IncludeDefaultLoader fallback); | 138 IncludeDefaultLoader fallback); |
149 | 139 |
150 // Removes a ShellImpl when it encounters an error. | 140 // Removes a ShellImpl when it encounters an error. |
151 void OnShellImplError(ShellImpl* shell_impl); | 141 void OnShellImplError(ShellImpl* shell_impl); |
152 // | 142 // |
153 // Removes a ContentHandler when it encounters an error. | 143 // Removes a ContentHandler when it encounters an error. |
(...skipping 15 matching lines...) Expand all Loading... |
169 std::set<ShellImpl*> content_shell_impls_; | 159 std::set<ShellImpl*> content_shell_impls_; |
170 | 160 |
171 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 161 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
172 | 162 |
173 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 163 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
174 }; | 164 }; |
175 | 165 |
176 } // namespace mojo | 166 } // namespace mojo |
177 | 167 |
178 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 168 #endif // MOJO_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
OLD | NEW |