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_SHELL_APPLICATION_MANAGER_H_ | 5 #ifndef MOJO_SHELL_APPLICATION_MANAGER_H_ |
6 #define MOJO_SHELL_APPLICATION_MANAGER_H_ | 6 #define MOJO_SHELL_APPLICATION_MANAGER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 private: | 93 private: |
94 using IdentityToInstanceMap = std::map<Identity, ApplicationInstance*>; | 94 using IdentityToInstanceMap = std::map<Identity, ApplicationInstance*>; |
95 using IdentityToContentHandlerMap = | 95 using IdentityToContentHandlerMap = |
96 std::map<Identity, ContentHandlerConnection*>; | 96 std::map<Identity, ContentHandlerConnection*>; |
97 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>; | 97 using URLToLoaderMap = std::map<GURL, ApplicationLoader*>; |
98 | 98 |
99 // Takes the contents of |params| only when it returns true. | 99 // Takes the contents of |params| only when it returns true. |
100 bool ConnectToRunningApplication( | 100 bool ConnectToRunningApplication( |
101 scoped_ptr<ConnectToApplicationParams>* params); | 101 scoped_ptr<ConnectToApplicationParams>* params); |
| 102 // |resolved_url| is the URL to load by |loader| (if loader is not null). It |
| 103 // may be different from |(*params)->app_url()| because of mappings and |
| 104 // resolution rules. |
| 105 // Takes the contents of |params| only when it returns true. |
| 106 void ConnectToApplicationWithLoader( |
| 107 scoped_ptr<ConnectToApplicationParams>* params, |
| 108 const GURL& resolved_url, |
| 109 ApplicationLoader* loader); |
102 | 110 |
103 InterfaceRequest<Application> CreateInstance( | 111 InterfaceRequest<Application> CreateInstance( |
104 scoped_ptr<ConnectToApplicationParams> params, | 112 scoped_ptr<ConnectToApplicationParams> params, |
105 ApplicationInstance** instance); | 113 ApplicationInstance** instance); |
106 | 114 |
107 // Called once |fetcher| has found app. |params->app_url()| is the url of | 115 // Called once |fetcher| has found app. |params->app_url()| is the url of |
108 // the requested application before any mappings/resolution have been applied. | 116 // the requested application before any mappings/resolution have been applied. |
109 // The corresponding URLRequest struct in |params| has been taken. | 117 // The corresponding URLRequest struct in |params| has been taken. |
110 void HandleFetchCallback(scoped_ptr<ConnectToApplicationParams> params, | 118 void HandleFetchCallback(scoped_ptr<ConnectToApplicationParams> params, |
111 scoped_ptr<Fetcher> fetcher); | 119 scoped_ptr<Fetcher> fetcher); |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
151 | 159 |
152 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); | 160 DISALLOW_COPY_AND_ASSIGN(ApplicationManager); |
153 }; | 161 }; |
154 | 162 |
155 Shell::ConnectToApplicationCallback EmptyConnectCallback(); | 163 Shell::ConnectToApplicationCallback EmptyConnectCallback(); |
156 | 164 |
157 } // namespace shell | 165 } // namespace shell |
158 } // namespace mojo | 166 } // namespace mojo |
159 | 167 |
160 #endif // MOJO_SHELL_APPLICATION_MANAGER_H_ | 168 #endif // MOJO_SHELL_APPLICATION_MANAGER_H_ |
OLD | NEW |