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

Unified Diff: chrome/browser/extensions/crx_installer.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 | « chrome/browser/download/save_package.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/crx_installer.h
diff --git a/chrome/browser/extensions/crx_installer.h b/chrome/browser/extensions/crx_installer.h
index 905a3f2980c60fbaf8f3148d2e824bbc16619fae..810a8fca10b6e3d377aea17beca31e4b0dee9582 100644
--- a/chrome/browser/extensions/crx_installer.h
+++ b/chrome/browser/extensions/crx_installer.h
@@ -90,6 +90,17 @@ class CrxInstaller
limit_web_extent_to_download_host_ = val;
}
+ // If |apps_require_extension_mime_type_| is set to true, be sure to set
+ // |original_mime_type_| as well.
+ void set_apps_require_extension_mime_type(
+ bool apps_require_extension_mime_type) {
+ apps_require_extension_mime_type_ = apps_require_extension_mime_type;
+ }
+
+ void set_original_mime_type(const std::string& original_mime_type) {
+ original_mime_type_ = original_mime_type;
+ }
+
private:
~CrxInstaller();
@@ -188,6 +199,14 @@ class CrxInstaller
// temp_dir_, so we don't have to delete it explicitly.
FilePath unpacked_extension_root_;
+ // True when the CRX being installed was just downloaded.
+ // Used to trigger extra checks before installing.
+ bool apps_require_extension_mime_type_;
+
+ // The value of the content type header sent with the CRX.
+ // Ignorred unless |require_extension_mime_type_| is true.
+ std::string original_mime_type_;
+
DISALLOW_COPY_AND_ASSIGN(CrxInstaller);
};
« no previous file with comments | « chrome/browser/download/save_package.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698