OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #include "mojo/shell/package_manager/package_manager_impl.h" | 5 #include "mojo/shell/package_manager/package_manager_impl.h" |
6 | 6 |
7 #include <stdint.h> | 7 #include <stdint.h> |
8 | 8 |
9 #include <utility> | 9 #include <utility> |
10 | 10 |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 // TODO(beng): this is eff'n weird. | 174 // TODO(beng): this is eff'n weird. |
175 new NetworkFetcher(disable_cache_, std::move(request), | 175 new NetworkFetcher(disable_cache_, std::move(request), |
176 url_loader_factory_.get(), loader_callback); | 176 url_loader_factory_.get(), loader_callback); |
177 } | 177 } |
178 | 178 |
179 uint32_t PackageManagerImpl::HandleWithContentHandler( | 179 uint32_t PackageManagerImpl::HandleWithContentHandler( |
180 Fetcher* fetcher, | 180 Fetcher* fetcher, |
181 const Identity& source, | 181 const Identity& source, |
182 const GURL& target_url, | 182 const GURL& target_url, |
183 const CapabilityFilter& target_filter, | 183 const CapabilityFilter& target_filter, |
184 InterfaceRequest<mojom::Application>* application_request) { | 184 InterfaceRequest<mojom::ShellClient>* request) { |
185 Identity content_handler_identity; | 185 Identity content_handler_identity; |
186 URLResponsePtr response; | 186 URLResponsePtr response; |
187 if (ShouldHandleWithContentHandler(fetcher, | 187 if (ShouldHandleWithContentHandler(fetcher, |
188 target_url, | 188 target_url, |
189 target_filter, | 189 target_filter, |
190 &content_handler_identity, | 190 &content_handler_identity, |
191 &response)) { | 191 &response)) { |
192 ContentHandlerConnection* connection = | 192 ContentHandlerConnection* connection = |
193 GetContentHandler(content_handler_identity, source); | 193 GetContentHandler(content_handler_identity, source); |
194 connection->StartApplication(std::move(*application_request), | 194 connection->StartApplication(std::move(*request), std::move(response)); |
195 std::move(response)); | |
196 return connection->id(); | 195 return connection->id(); |
197 } | 196 } |
198 return mojom::Shell::kInvalidApplicationID; | 197 return mojom::Shell::kInvalidApplicationID; |
199 } | 198 } |
200 | 199 |
201 bool PackageManagerImpl::IsURLInCatalog(const std::string& url) const { | 200 bool PackageManagerImpl::IsURLInCatalog(const std::string& url) const { |
202 return catalog_.find(url) != catalog_.end(); | 201 return catalog_.find(url) != catalog_.end(); |
203 } | 202 } |
204 | 203 |
205 std::string PackageManagerImpl::GetApplicationName( | 204 std::string PackageManagerImpl::GetApplicationName( |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 return; | 381 return; |
383 | 382 |
384 base::DictionaryValue* dictionary = nullptr; | 383 base::DictionaryValue* dictionary = nullptr; |
385 CHECK(manifest->GetAsDictionary(&dictionary)); | 384 CHECK(manifest->GetAsDictionary(&dictionary)); |
386 DeserializeApplication(dictionary); | 385 DeserializeApplication(dictionary); |
387 SerializeCatalog(); | 386 SerializeCatalog(); |
388 } | 387 } |
389 | 388 |
390 } // namespace shell | 389 } // namespace shell |
391 } // namespace mojo | 390 } // namespace mojo |
OLD | NEW |