| Index: chrome/browser/android/offline_pages/offline_page_utils.cc
|
| diff --git a/chrome/browser/android/offline_pages/offline_page_utils.cc b/chrome/browser/android/offline_pages/offline_page_utils.cc
|
| index 1fdff62a48491771916071118f8e3da26e7c54b0..48dda928449c6dea04058e40600f8323dc871da5 100644
|
| --- a/chrome/browser/android/offline_pages/offline_page_utils.cc
|
| +++ b/chrome/browser/android/offline_pages/offline_page_utils.cc
|
| @@ -29,6 +29,7 @@
|
| #include "content/public/browser/browser_context.h"
|
| #include "content/public/browser/navigation_entry.h"
|
| #include "content/public/browser/web_contents.h"
|
| +#include "net/base/mime_util.h"
|
|
|
| namespace offline_pages {
|
| namespace {
|
| @@ -298,4 +299,13 @@ void OfflinePageUtils::ScheduleDownload(content::WebContents* web_contents,
|
| tab_helper->ScheduleDownloadHelper(web_contents, name_space, url, ui_action);
|
| }
|
|
|
| +// static
|
| +bool OfflinePageUtils::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"));
|
| +}
|
| +
|
| } // namespace offline_pages
|
|
|