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

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

Issue 2830017: Disallow apps with the wrong content type header. (Closed)
Patch Set: Rebase for checkin. Created 10 years, 6 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 | « no previous file | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/download/download_manager.h
diff --git a/chrome/browser/download/download_manager.h b/chrome/browser/download/download_manager.h
index 413d92de737c7837561aadcfa405b47c00045a68..ee9dff81fa73e6b279ab33ee1fb6661a206e9481 100644
--- a/chrome/browser/download/download_manager.h
+++ b/chrome/browser/download/download_manager.h
@@ -114,6 +114,7 @@ class DownloadItem {
const GURL& url,
const GURL& referrer_url,
const std::string& mime_type,
+ const std::string& original_mime_type,
const FilePath& original_name,
const base::Time start_time,
int64 download_size,
@@ -199,6 +200,7 @@ class DownloadItem {
GURL url() const { return url_; }
GURL referrer_url() const { return referrer_url_; }
std::string mime_type() const { return mime_type_; }
+ std::string original_mime_type() const { return original_mime_type_; }
int64 total_bytes() const { return total_bytes_; }
void set_total_bytes(int64 total_bytes) { total_bytes_ = total_bytes; }
int64 received_bytes() const { return received_bytes_; }
@@ -263,6 +265,10 @@ class DownloadItem {
// The mimetype of the download
std::string mime_type_;
+ // The value of the content type header received when downloading
+ // this item. |mime_type_| may be different because of type sniffing.
+ std::string original_mime_type_;
+
// Total bytes expected
int64 total_bytes_;
@@ -577,8 +583,10 @@ class DownloadManager : public base::RefCountedThreadSafe<DownloadManager>,
gfx::NativeView parent_window);
// Opens downloaded Chrome extension file (*.crx).
- void OpenChromeExtension(const FilePath& full_path, const GURL& download_url,
- const GURL& referrer_url);
+ void OpenChromeExtension(const FilePath& full_path,
+ const GURL& download_url,
+ const GURL& referrer_url,
+ const std::string& original_mime_type);
// Shutdown the download manager. This call is needed only after Init.
void Shutdown();
« no previous file with comments | « no previous file | chrome/browser/download/download_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698