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

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

Issue 160254: 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 21813)
+++ 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()),
@@ -142,6 +144,7 @@
int path_uniquifier,
const GURL& url,
const GURL& referrer_url,
+ const std::string& mime_type,
const FilePath& original_name,
const base::Time start_time,
int64 download_size,
@@ -153,6 +156,7 @@
path_uniquifier_(path_uniquifier),
url_(url),
referrer_url_(referrer_url),
+ mime_type_(mime_type),
total_bytes_(download_size),
received_bytes_(0),
start_tick_(base::TimeTicks::Now()),
@@ -677,6 +681,7 @@
info->path_uniquifier,
info->url,
info->referrer_url,
+ info->mime_type,
info->original_name,
info->start_time,
info->total_bytes,
@@ -841,7 +846,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->url(),
download->referrer_url());
download->set_auto_opened(true);
@@ -1211,7 +1216,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(), download->url(),
download->referrer_url());
} else {
Property changes on: chrome\browser\download\download_manager.cc
___________________________________________________________________
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/download/download_manager.cc:r21612
« 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