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

Unified Diff: chrome/browser/extensions/unpacked_installer.h

Issue 10912041: Disallow packing or loading unpacked manifest v1 extensions. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: blarh Created 8 years, 3 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/extensions/pack_extension_job.cc ('k') | chrome/browser/extensions/unpacked_installer.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/unpacked_installer.h
diff --git a/chrome/browser/extensions/unpacked_installer.h b/chrome/browser/extensions/unpacked_installer.h
index 2cc3ec420545a708b23da80af55707d98b108377..0aa1f93fbc39eda47a92280058a79f846f909416 100644
--- a/chrome/browser/extensions/unpacked_installer.h
+++ b/chrome/browser/extensions/unpacked_installer.h
@@ -41,6 +41,15 @@ class UnpackedInstaller
bool prompt_for_plugins() { return prompt_for_plugins_; }
void set_prompt_for_plugins(bool val) { prompt_for_plugins_ = val; }
+ // Allows overriding of whether modern manifest versions are required;
+ // intended for testing.
+ bool require_modern_manifest_version() const {
+ return require_modern_manifest_version_;
+ }
+ void set_require_modern_manifest_version(bool val) {
+ require_modern_manifest_version_ = val;
+ }
+
private:
friend class base::RefCountedThreadSafe<UnpackedInstaller>;
@@ -59,7 +68,7 @@ class UnpackedInstaller
// what file access flags to pass to extension_file_util::LoadExtension.
void GetAbsolutePath();
void CheckExtensionFileAccess();
- void LoadWithFileAccess(bool allow_file_access);
+ void LoadWithFileAccess(int flags);
// Notify the frontend that there was an error loading an extension.
void ReportExtensionLoadError(const std::string& error);
@@ -67,6 +76,9 @@ class UnpackedInstaller
// Called when an unpacked extension has been loaded and installed.
void OnLoaded(const scoped_refptr<const Extension>& extension);
+ // Helper to get the Extension::CreateFlags for the installing extension.
+ int GetFlags();
+
base::WeakPtr<ExtensionService> service_weak_;
// The pathname of the directory to load from, which is an absolute path
@@ -77,6 +89,10 @@ class UnpackedInstaller
// loading.
bool prompt_for_plugins_;
+ // Whether to require the extension installed to have a modern manifest
+ // version.
+ bool require_modern_manifest_version_;
+
DISALLOW_COPY_AND_ASSIGN(UnpackedInstaller);
};
« no previous file with comments | « chrome/browser/extensions/pack_extension_job.cc ('k') | chrome/browser/extensions/unpacked_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698