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 SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 5 #ifndef SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 6 #define SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 class ContentHandlerConnection; | 133 class ContentHandlerConnection; |
134 | 134 |
135 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap; | 135 typedef std::map<std::string, ApplicationLoader*> SchemeToLoaderMap; |
136 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap; | 136 typedef std::map<GURL, ApplicationLoader*> URLToLoaderMap; |
137 typedef std::map<Identity, ShellImpl*> IdentityToShellImplMap; | 137 typedef std::map<Identity, ShellImpl*> IdentityToShellImplMap; |
138 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap; | 138 typedef std::map<GURL, ContentHandlerConnection*> URLToContentHandlerMap; |
139 typedef std::map<GURL, std::vector<std::string>> URLToArgsMap; | 139 typedef std::map<GURL, std::vector<std::string>> URLToArgsMap; |
140 typedef std::map<std::string, GURL> MimeTypeToURLMap; | 140 typedef std::map<std::string, GURL> MimeTypeToURLMap; |
141 typedef std::map<GURL, NativeRunnerFactory::Options> URLToNativeOptionsMap; | 141 typedef std::map<GURL, NativeRunnerFactory::Options> URLToNativeOptionsMap; |
142 | 142 |
| 143 void ConnectToApplicationWithParameters( |
| 144 const GURL& application_url, |
| 145 const GURL& requestor_url, |
| 146 InterfaceRequest<ServiceProvider> services, |
| 147 ServiceProviderPtr exposed_services, |
| 148 const std::vector<std::string>& parameters); |
| 149 |
143 bool ConnectToRunningApplication(const GURL& resolved_url, | 150 bool ConnectToRunningApplication(const GURL& resolved_url, |
144 const GURL& requestor_url, | 151 const GURL& requestor_url, |
145 InterfaceRequest<ServiceProvider>* services, | 152 InterfaceRequest<ServiceProvider>* services, |
146 ServiceProviderPtr* exposed_services); | 153 ServiceProviderPtr* exposed_services); |
147 | 154 |
148 bool ConnectToApplicationWithLoader( | 155 bool ConnectToApplicationWithLoader( |
149 const GURL& requested_url, | 156 const GURL& requested_url, |
150 const GURL& resolved_url, | 157 const GURL& resolved_url, |
151 const GURL& requestor_url, | 158 const GURL& requestor_url, |
152 InterfaceRequest<ServiceProvider>* services, | 159 InterfaceRequest<ServiceProvider>* services, |
153 ServiceProviderPtr* exposed_services, | 160 ServiceProviderPtr* exposed_services, |
| 161 const std::vector<std::string>& parameters, |
154 ApplicationLoader* loader); | 162 ApplicationLoader* loader); |
155 | 163 |
156 InterfaceRequest<Application> RegisterShell( | 164 InterfaceRequest<Application> RegisterShell( |
157 // The original URL requested by client, before any resolution or | 165 // The original URL requested by client, before any resolution or |
158 // redirects. | 166 // redirects. |
159 // This is mostly useless and should be removed. | 167 // This is mostly useless and should be removed. |
160 const GURL& original_url, | 168 const GURL& original_url, |
161 // The URL after resolution and redirects, including the querystring. | 169 // The URL after resolution and redirects, including the querystring. |
162 const GURL& resolved_url, | 170 const GURL& resolved_url, |
163 const GURL& requestor_url, | 171 const GURL& requestor_url, |
164 InterfaceRequest<ServiceProvider> services, | 172 InterfaceRequest<ServiceProvider> services, |
165 ServiceProviderPtr exposed_services); | 173 ServiceProviderPtr exposed_services, |
| 174 const std::vector<std::string>& parameters); |
166 | 175 |
167 ShellImpl* GetShellImpl(const GURL& url); | 176 ShellImpl* GetShellImpl(const GURL& url); |
168 | 177 |
169 void ConnectToClient(ShellImpl* shell_impl, | 178 void ConnectToClient(ShellImpl* shell_impl, |
170 const GURL& resolved_url, | 179 const GURL& resolved_url, |
171 const GURL& requestor_url, | 180 const GURL& requestor_url, |
172 InterfaceRequest<ServiceProvider> services, | 181 InterfaceRequest<ServiceProvider> services, |
173 ServiceProviderPtr exposed_services); | 182 ServiceProviderPtr exposed_services); |
174 | 183 |
175 void HandleFetchCallback(const GURL& requested_url, | 184 void HandleFetchCallback(const GURL& requested_url, |
176 const GURL& requestor_url, | 185 const GURL& requestor_url, |
177 InterfaceRequest<ServiceProvider> services, | 186 InterfaceRequest<ServiceProvider> services, |
178 ServiceProviderPtr exposed_services, | 187 ServiceProviderPtr exposed_services, |
| 188 const std::vector<std::string>& parameters, |
179 NativeRunner::CleanupBehavior cleanup_behavior, | 189 NativeRunner::CleanupBehavior cleanup_behavior, |
180 scoped_ptr<Fetcher> fetcher); | 190 scoped_ptr<Fetcher> fetcher); |
181 | 191 |
182 void RunNativeApplication(InterfaceRequest<Application> application_request, | 192 void RunNativeApplication(InterfaceRequest<Application> application_request, |
183 const NativeRunnerFactory::Options& options, | 193 const NativeRunnerFactory::Options& options, |
184 NativeRunner::CleanupBehavior cleanup_behavior, | 194 NativeRunner::CleanupBehavior cleanup_behavior, |
185 scoped_ptr<Fetcher> fetcher, | 195 scoped_ptr<Fetcher> fetcher, |
186 const base::FilePath& file_path, | 196 const base::FilePath& file_path, |
187 bool path_exists); | 197 bool path_exists); |
188 | 198 |
189 void LoadWithContentHandler(const GURL& content_handler_url, | 199 void LoadWithContentHandler(const GURL& content_handler_url, |
190 InterfaceRequest<Application> application_request, | 200 InterfaceRequest<Application> application_request, |
191 URLResponsePtr url_response); | 201 URLResponsePtr url_response); |
192 | 202 |
193 // Return the appropriate loader for |url|. This can return NULL if there is | 203 // Return the appropriate loader for |url|. This can return NULL if there is |
194 // no loader configured for the URL. | 204 // no loader configured for the URL. |
195 ApplicationLoader* GetLoaderForURL(const GURL& url); | 205 ApplicationLoader* GetLoaderForURL(const GURL& url); |
196 | 206 |
197 // Removes a ContentHandler when it encounters an error. | 207 // Removes a ContentHandler when it encounters an error. |
198 void OnContentHandlerError(ContentHandlerConnection* content_handler); | 208 void OnContentHandlerError(ContentHandlerConnection* content_handler); |
199 | 209 |
200 // Returns the arguments for the given url. | 210 // Returns the arguments for the given url. |
201 Array<String> GetArgsForURL(const GURL& url); | 211 std::vector<std::string> GetArgsForURL(const GURL& url); |
202 | 212 |
203 void CleanupRunner(NativeRunner* runner); | 213 void CleanupRunner(NativeRunner* runner); |
204 | 214 |
205 Delegate* const delegate_; | 215 Delegate* const delegate_; |
206 // Loader management. | 216 // Loader management. |
207 // Loaders are chosen in the order they are listed here. | 217 // Loaders are chosen in the order they are listed here. |
208 URLToLoaderMap url_to_loader_; | 218 URLToLoaderMap url_to_loader_; |
209 SchemeToLoaderMap scheme_to_loader_; | 219 SchemeToLoaderMap scheme_to_loader_; |
210 scoped_ptr<ApplicationLoader> default_loader_; | 220 scoped_ptr<ApplicationLoader> default_loader_; |
211 scoped_ptr<NativeRunnerFactory> native_runner_factory_; | 221 scoped_ptr<NativeRunnerFactory> native_runner_factory_; |
(...skipping 11 matching lines...) Expand all Loading... |
223 bool disable_cache_; | 233 bool disable_cache_; |
224 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; | 234 base::WeakPtrFactory<ApplicationManager> weak_ptr_factory_; |
225 | 235 |
226 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 236 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
227 }; | 237 }; |
228 | 238 |
229 } // namespace shell | 239 } // namespace shell |
230 } // namespace mojo | 240 } // namespace mojo |
231 | 241 |
232 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ | 242 #endif // SHELL_APPLICATION_MANAGER_APPLICATION_MANAGER_H_ |
OLD | NEW |