| 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/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| 11 #include "base/path_service.h" | 11 #include "base/path_service.h" |
| 12 #include "base/singleton.h" | 12 #include "base/singleton.h" |
| 13 #include "base/string_util.h" | 13 #include "base/string_util.h" |
| 14 #include "base/thread.h" | 14 #include "base/thread.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #if defined(OS_WIN) | 16 #if defined(OS_WIN) |
| 17 #include "base/win_util.h" | 17 #include "base/win_util.h" |
| 18 #endif | 18 #endif |
| 19 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h" | 19 #include "chrome/browser/appcache/view_appcache_internals_job_factory.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/chrome_thread.h" | 21 #include "chrome/browser/chrome_thread.h" |
| 22 #include "chrome/browser/net/chrome_url_request_context.h" | 22 #include "chrome/browser/net/chrome_url_request_context.h" |
| 23 #include "chrome/browser/net/view_net_internals_job_factory.h" | 23 #include "chrome/browser/net/view_http_cache_job_factory.h" |
| 24 #include "chrome/common/chrome_paths.h" | 24 #include "chrome/common/chrome_paths.h" |
| 25 #include "chrome/common/ref_counted_util.h" | 25 #include "chrome/common/ref_counted_util.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "googleurl/src/url_util.h" | 27 #include "googleurl/src/url_util.h" |
| 28 #include "grit/platform_locale_settings.h" | 28 #include "grit/platform_locale_settings.h" |
| 29 #include "net/base/io_buffer.h" | 29 #include "net/base/io_buffer.h" |
| 30 #include "net/base/net_errors.h" | 30 #include "net/base/net_errors.h" |
| 31 #include "net/url_request/url_request.h" | 31 #include "net/url_request/url_request.h" |
| 32 #include "net/url_request/url_request_file_job.h" | 32 #include "net/url_request/url_request_file_job.h" |
| 33 #include "net/url_request/url_request_job.h" | 33 #include "net/url_request/url_request_job.h" |
| (...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 base::i18n::IsRTL() ? L"rtl" : L"ltr"); | 318 base::i18n::IsRTL() ? L"rtl" : L"ltr"); |
| 319 } | 319 } |
| 320 | 320 |
| 321 URLRequestJob* ChromeURLDataManager::Factory(URLRequest* request, | 321 URLRequestJob* ChromeURLDataManager::Factory(URLRequest* request, |
| 322 const std::string& scheme) { | 322 const std::string& scheme) { |
| 323 // Try first with a file handler | 323 // Try first with a file handler |
| 324 FilePath path; | 324 FilePath path; |
| 325 if (ChromeURLDataManager::URLToFilePath(request->url(), &path)) | 325 if (ChromeURLDataManager::URLToFilePath(request->url(), &path)) |
| 326 return new URLRequestChromeFileJob(request, path); | 326 return new URLRequestChromeFileJob(request, path); |
| 327 | 327 |
| 328 // Next check for chrome://net-internals/, which uses its own job type. | 328 // Next check for chrome://view-http-cache/*, which uses its own job type. |
| 329 if (ViewNetInternalsJobFactory::IsSupportedURL(request->url())) | 329 if (ViewHttpCacheJobFactory::IsSupportedURL(request->url())) |
| 330 return ViewNetInternalsJobFactory::CreateJobForRequest(request); | 330 return ViewHttpCacheJobFactory::CreateJobForRequest(request); |
| 331 | 331 |
| 332 // Next check for chrome://appcache-internals/, which uses its own job type. | 332 // Next check for chrome://appcache-internals/, which uses its own job type. |
| 333 if (ViewAppCacheInternalsJobFactory::IsSupportedURL(request->url())) | 333 if (ViewAppCacheInternalsJobFactory::IsSupportedURL(request->url())) |
| 334 return ViewAppCacheInternalsJobFactory::CreateJobForRequest(request); | 334 return ViewAppCacheInternalsJobFactory::CreateJobForRequest(request); |
| 335 | 335 |
| 336 // Fall back to using a custom handler | 336 // Fall back to using a custom handler |
| 337 return new URLRequestChromeJob(request); | 337 return new URLRequestChromeJob(request); |
| 338 } | 338 } |
| 339 | 339 |
| 340 URLRequestChromeJob::URLRequestChromeJob(URLRequest* request) | 340 URLRequestChromeJob::URLRequestChromeJob(URLRequest* request) |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 net::ERR_INVALID_URL)); | 422 net::ERR_INVALID_URL)); |
| 423 } | 423 } |
| 424 } | 424 } |
| 425 | 425 |
| 426 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, | 426 URLRequestChromeFileJob::URLRequestChromeFileJob(URLRequest* request, |
| 427 const FilePath& path) | 427 const FilePath& path) |
| 428 : URLRequestFileJob(request, path) { | 428 : URLRequestFileJob(request, path) { |
| 429 } | 429 } |
| 430 | 430 |
| 431 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } | 431 URLRequestChromeFileJob::~URLRequestChromeFileJob() { } |
| OLD | NEW |