| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "content/browser/appcache/view_appcache_internals_job_factory.h" | 5 #include "content/browser/appcache/view_appcache_internals_job_factory.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" |
| 7 #include "chrome/browser/net/chrome_url_request_context.h" | 8 #include "chrome/browser/net/chrome_url_request_context.h" |
| 8 #include "chrome/common/url_constants.h" | 9 #include "chrome/common/url_constants.h" |
| 9 #include "net/url_request/url_request.h" | 10 #include "net/url_request/url_request.h" |
| 10 #include "webkit/appcache/appcache_service.h" | 11 #include "webkit/appcache/appcache_service.h" |
| 11 #include "webkit/appcache/view_appcache_internals_job.h" | 12 #include "webkit/appcache/view_appcache_internals_job.h" |
| 12 | 13 |
| 13 // static. | 14 // static. |
| 14 bool ViewAppCacheInternalsJobFactory::IsSupportedURL(const GURL& url) { | 15 bool ViewAppCacheInternalsJobFactory::IsSupportedURL(const GURL& url) { |
| 15 return StartsWithASCII(url.spec(), | 16 return StartsWithASCII(url.spec(), |
| 16 chrome::kAppCacheViewInternalsURL, | 17 chrome::kAppCacheViewInternalsURL, |
| 17 true /*case_sensitive*/); | 18 true /*case_sensitive*/); |
| 18 } | 19 } |
| 19 | 20 |
| 20 // static. | 21 // static. |
| 21 net::URLRequestJob* ViewAppCacheInternalsJobFactory::CreateJobForRequest( | 22 net::URLRequestJob* ViewAppCacheInternalsJobFactory::CreateJobForRequest( |
| 22 net::URLRequest* request) { | 23 net::URLRequest* request) { |
| 23 net::URLRequestContext* context = request->context(); | 24 net::URLRequestContext* context = request->context(); |
| 24 ChromeURLRequestContext* chrome_request_context = | 25 ChromeURLRequestContext* chrome_request_context = |
| 25 reinterpret_cast<ChromeURLRequestContext*>(context); | 26 reinterpret_cast<ChromeURLRequestContext*>(context); |
| 26 return new appcache::ViewAppCacheInternalsJob( | 27 return new appcache::ViewAppCacheInternalsJob( |
| 27 request, chrome_request_context->appcache_service()); | 28 request, chrome_request_context->appcache_service()); |
| 28 } | 29 } |
| OLD | NEW |