| Index: chrome/browser/android/offline_pages/downloads/resource_throttle.cc
|
| diff --git a/chrome/browser/android/offline_pages/downloads/resource_throttle.cc b/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
|
| index a09b33c4abf26c70f13b2834710a8b659e385148..ee6aec8c702f1dfd0ea6a899ba3b019f13d9023f 100644
|
| --- a/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
|
| +++ b/chrome/browser/android/offline_pages/downloads/resource_throttle.cc
|
| @@ -13,11 +13,13 @@
|
| #include "net/base/mime_util.h"
|
|
|
| namespace {
|
| -// Mime type of download resource that should trigger handoff to OfflinePages
|
| -// backend for full page load and snapshot.
|
| -bool CanDownloadAsOfflinePage(const std::string& contents_mime_type) {
|
| - return net::MatchesMimeType(contents_mime_type, "text/html") ||
|
| - net::MatchesMimeType(contents_mime_type, "application/xhtml+xml");
|
| +// Check if the url and mime type of a download resource should trigger handoff
|
| +// to OfflinePages backend for full page load and snapshot.
|
| +bool CanDownloadAsOfflinePage(
|
| + const GURL& url, const std::string& contents_mime_type) {
|
| + return url.SchemeIsHTTPOrHTTPS() &&
|
| + (net::MatchesMimeType(contents_mime_type, "text/html") ||
|
| + net::MatchesMimeType(contents_mime_type, "application/xhtml+xml"));
|
| }
|
|
|
| void WillStartOfflineRequestOnUIThread(
|
| @@ -49,7 +51,8 @@ void ResourceThrottle::WillProcessResponse(bool* defer) {
|
| DCHECK_CURRENTLY_ON(content::BrowserThread::IO);
|
| std::string mime_type;
|
| request_->GetMimeType(&mime_type);
|
| - if (CanDownloadAsOfflinePage(mime_type)) {
|
| +
|
| + if (CanDownloadAsOfflinePage(request_->url(), mime_type)) {
|
| const content::ResourceRequestInfo* info =
|
| content::ResourceRequestInfo::ForRequest(request_);
|
| if (!info)
|
|
|