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

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

Issue 160243: Merge 21612 - Implement mimetype sniffing for extensions.... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 years, 5 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
« no previous file with comments | « chrome/browser/download/download_manager.h ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.cc
===================================================================
--- chrome/browser/download/download_manager.cc (revision 21799)
+++ chrome/browser/download/download_manager.cc (working copy)
@@ -117,6 +117,8 @@
: id_(-1),
full_path_(info.path),
url_(info.url),
+ referrer_url_(info.referrer_url),
+ mime_type_(info.mime_type),
total_bytes_(info.total_bytes),
received_bytes_(info.received_bytes),
start_tick_(base::TimeTicks()),
@@ -141,6 +143,7 @@
const FilePath& path,
int path_uniquifier,
const GURL& url,
+ const std::string& mime_type,
const FilePath& original_name,
const base::Time start_time,
int64 download_size,
@@ -151,6 +154,7 @@
full_path_(path),
path_uniquifier_(path_uniquifier),
url_(url),
+ mime_type_(mime_type),
total_bytes_(download_size),
received_bytes_(0),
start_tick_(base::TimeTicks::Now()),
@@ -674,6 +678,7 @@
info->path,
info->path_uniquifier,
info->url,
+ info->mime_type,
info->original_name,
info->start_time,
info->total_bytes,
@@ -838,7 +843,7 @@
extension = extension.substr(1);
// Handle chrome extensions explicitly and skip the shell execute.
- if (Extension::IsExtension(download->full_path())) {
+ if (download->mime_type() == Extension::kMimeType) {
OpenChromeExtension(download->full_path());
download->set_auto_opened(true);
} else if (download->open_when_complete() ||
@@ -1207,7 +1212,7 @@
gfx::NativeView parent_window) {
// Open Chrome extensions with ExtensionsService. For everything else do shell
// execute.
- if (Extension::IsExtension(download->full_path())) {
+ if (download->mime_type() == Extension::kMimeType) {
OpenChromeExtension(download->full_path());
} else {
OpenDownloadInShell(download, parent_window);
Property changes on: chrome\browser\download\download_manager.cc
___________________________________________________________________
Added: svn:mergeinfo
Merged /trunk/src/chrome/browser/download/download_manager.cc:r21612
Merged /branches/chrome_webkit_merge_branch/chrome/browser/download/download_manager.cc:r69-2775
« no previous file with comments | « chrome/browser/download/download_manager.h ('k') | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698