Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #include "mojo/shell/test_package_manager.h" | |
| 6 | |
| 7 #include "mojo/shell/fetcher.h" | |
| 8 #include "url/gurl.h" | |
| 9 | |
| 10 namespace mojo { | |
| 11 namespace shell { | |
| 12 | |
| 13 TestPackageManager::TestPackageManager() {} | |
| 14 TestPackageManager::~TestPackageManager() {} | |
| 15 | |
| 16 void TestPackageManager::RegisterContentHandler( | |
| 17 const std::string& mime_type, | |
| 18 const GURL& content_handler_url) { | |
|
yzshen1
2015/09/16 23:47:20
I think this method needs to be implemented.
| |
| 19 } | |
| 20 | |
| 21 void TestPackageManager::SetApplicationManager(ApplicationManager* manager) { | |
| 22 } | |
| 23 | |
| 24 GURL TestPackageManager::ResolveURL(const GURL& url) { | |
| 25 return url; | |
| 26 } | |
| 27 | |
| 28 void TestPackageManager::FetchRequest( | |
| 29 URLRequestPtr request, | |
| 30 const Fetcher::FetchCallback& loader_callback) {} | |
| 31 | |
| 32 bool TestPackageManager::HandleWithContentHandler( | |
| 33 Fetcher* fetcher, | |
| 34 const GURL& unresolved_url, | |
| 35 base::TaskRunner* task_runner, | |
| 36 URLResponsePtr* new_response, | |
| 37 GURL* content_handler_url, | |
| 38 std::string* qualifier) { | |
| 39 MimeTypeToURLMap::iterator iter = mime_type_to_url_.find(fetcher->MimeType()); | |
| 40 if (iter != mime_type_to_url_.end()) { | |
| 41 *new_response = fetcher->AsURLResponse(task_runner, 0); | |
| 42 *content_handler_url = iter->second; | |
| 43 *qualifier = (*new_response)->site.To<std::string>(); | |
| 44 return true; | |
| 45 } | |
| 46 return false; | |
| 47 } | |
| 48 | |
| 49 } // namespace shell | |
| 50 } // namespace mojo | |
| OLD | NEW |