| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "chrome/browser/dom_ui/chrome_url_data_manager.h" | 5 #include "chrome/browser/dom_ui/chrome_url_data_manager.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
| (...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 87 private: | 87 private: |
| 88 virtual ~URLRequestChromeFileJob(); | 88 virtual ~URLRequestChromeFileJob(); |
| 89 | 89 |
| 90 DISALLOW_EVIL_CONSTRUCTORS(URLRequestChromeFileJob); | 90 DISALLOW_EVIL_CONSTRUCTORS(URLRequestChromeFileJob); |
| 91 }; | 91 }; |
| 92 | 92 |
| 93 void RegisterURLRequestChromeJob() { | 93 void RegisterURLRequestChromeJob() { |
| 94 // Being a standard scheme allows us to resolve relative paths. This method | 94 // Being a standard scheme allows us to resolve relative paths. This method |
| 95 // is invoked multiple times during testing, so only add the scheme once. | 95 // is invoked multiple times during testing, so only add the scheme once. |
| 96 url_parse::Component url_scheme_component(0, strlen(chrome::kChromeUIScheme)); | 96 url_parse::Component url_scheme_component(0, strlen(chrome::kChromeUIScheme)); |
| 97 if (!url_util::IsStandard(chrome::kChromeUIScheme, | 97 if (!url_util::IsStandard(chrome::kChromeUIScheme, url_scheme_component)) |
| 98 strlen(chrome::kChromeUIScheme), | |
| 99 url_scheme_component)) { | |
| 100 url_util::AddStandardScheme(chrome::kChromeUIScheme); | 98 url_util::AddStandardScheme(chrome::kChromeUIScheme); |
| 101 } | |
| 102 | 99 |
| 103 FilePath inspector_dir; | 100 FilePath inspector_dir; |
| 104 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { | 101 if (PathService::Get(chrome::DIR_INSPECTOR, &inspector_dir)) { |
| 105 Singleton<ChromeURLDataManager>()->AddFileSource( | 102 Singleton<ChromeURLDataManager>()->AddFileSource( |
| 106 chrome::kChromeUIDevToolsHost, inspector_dir); | 103 chrome::kChromeUIDevToolsHost, inspector_dir); |
| 107 } | 104 } |
| 108 | 105 |
| 109 URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, | 106 URLRequest::RegisterProtocolFactory(chrome::kChromeUIScheme, |
| 110 &ChromeURLDataManager::Factory); | 107 &ChromeURLDataManager::Factory); |
| 111 URLRequest::RegisterProtocolFactory(chrome::kPrintScheme, | 108 URLRequest::RegisterProtocolFactory(chrome::kPrintScheme, |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 436 net::ERR_INVALID_URL)); | 433 net::ERR_INVALID_URL)); |
| 437 } | 434 } |
| 438 } | 435 } |
| 439 | 436 |
| 440 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, | 437 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, |
| 441 const FilePath& path) | 438 const FilePath& path) |
| 442 : URLRequestFileJob(request, path) { | 439 : URLRequestFileJob(request, path) { |
| 443 } | 440 } |
| 444 | 441 |
| 445 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } | 442 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } |
| OLD | NEW |