Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1337)

Unified Diff: chrome/browser/download/chrome_download_manager_delegate.cc

Issue 9651020: Pass content-type resources to web intents. Goes through download, then invokes the p… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Move dispatch logic client-side. Created 8 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/download/chrome_download_manager_delegate.cc
diff --git a/chrome/browser/download/chrome_download_manager_delegate.cc b/chrome/browser/download/chrome_download_manager_delegate.cc
index 4211ffe2648da72b567756950aa0f3694b86ec6a..ae9d54bb18342c462912d641dfab08baedf9536e 100644
--- a/chrome/browser/download/chrome_download_manager_delegate.cc
+++ b/chrome/browser/download/chrome_download_manager_delegate.cc
@@ -208,6 +208,23 @@ bool ChromeDownloadManagerDelegate::ShouldCompleteDownload(DownloadItem* item) {
return true;
}
+bool ChromeDownloadManagerDelegate::ShouldOpenWithWebIntent(
+ DownloadItem* item) {
+ std::string mime_type = item->GetMimeType();
+ LOG(INFO) << "Testing " << mime_type << " for web intents";
+
+ // TODO: Check for explicit user-caused download?
+
+ if (mime_type == "application/rss+xml" ||
jam 2012/03/16 21:36:26 why is this stuff in chrome?
Greg Billock 2012/03/18 00:32:21 This method is basically a policy delegation to th
+ mime_type == "application/atom+xml" ||
+ mime_type == "application/ms-word" ||
+ mime_type == "application/pdf") {
+ return true;
+ }
+
+ return false;
+}
+
bool ChromeDownloadManagerDelegate::ShouldOpenDownload(DownloadItem* item) {
if (!IsExtensionDownload(item)) {
return true;

Powered by Google App Engine
This is Rietveld 408576698