summaryrefslogtreecommitdiffstats
path: root/chrome/browser/extensions/unpacked_installer.h
diff options
context:
space:
mode:
authoreaugusti@chromium.org <eaugusti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 20:51:24 +0000
committereaugusti@chromium.org <eaugusti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-09-11 20:51:24 +0000
commit9827043f58d7b90a2cccd7017134a7d9ae3bdbca (patch)
tree5e4cef6e23ba06f89c75718342e5dd84894d9c8a /chrome/browser/extensions/unpacked_installer.h
parent9b6d7c58f69ebda1bffdbbcd17e3343ac5fb5436 (diff)
downloadchromium_src-9827043f58d7b90a2cccd7017134a7d9ae3bdbca.zip
chromium_src-9827043f58d7b90a2cccd7017134a7d9ae3bdbca.tar.gz
chromium_src-9827043f58d7b90a2cccd7017134a7d9ae3bdbca.tar.bz2
Enforce the 'requirements' field in manifests.
Try 2. First try: https://chromiumcodereview.appspot.com/10689097 BUG=133027, 130405 TBR=jhawkins@chromium.org, aa@chromium.org Review URL: https://chromiumcodereview.appspot.com/10908184 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@156119 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/unpacked_installer.h')
-rw-r--r--chrome/browser/extensions/unpacked_installer.h19
1 files changed, 17 insertions, 2 deletions
diff --git a/chrome/browser/extensions/unpacked_installer.h b/chrome/browser/extensions/unpacked_installer.h
index 0aa1f93..6b48857 100644
--- a/chrome/browser/extensions/unpacked_installer.h
+++ b/chrome/browser/extensions/unpacked_installer.h
@@ -6,9 +6,11 @@
#define CHROME_BROWSER_EXTENSIONS_UNPACKED_INSTALLER_H_
#include <string>
+#include <vector>
#include "base/file_path.h"
#include "base/memory/ref_counted.h"
+#include "base/memory/scoped_ptr.h"
#include "base/memory/weak_ptr.h"
class ExtensionService;
@@ -16,8 +18,11 @@ class ExtensionService;
namespace extensions {
class Extension;
+class RequirementsChecker;
-// Installs and loads an unpacked extension.
+// Installs and loads an unpacked extension. Because internal state needs to be
+// held about the instalation process, only one call to Load*() should be made
+// per UnpackedInstaller.
// TODO(erikkay): It might be useful to be able to load a packed extension
// (presumably into memory) without installing it.
class UnpackedInstaller
@@ -56,6 +61,12 @@ class UnpackedInstaller
explicit UnpackedInstaller(ExtensionService* extension_service);
virtual ~UnpackedInstaller();
+ // Must be called from the UI thread.
+ void CheckRequirements();
+
+ // Callback from RequirementsChecker.
+ void OnRequirementsChecked(std::vector<std::string> requirement_errors);
+
// Verifies if loading unpacked extensions is allowed.
bool IsLoadingUnpackedAllowed() const;
@@ -74,7 +85,7 @@ class UnpackedInstaller
void ReportExtensionLoadError(const std::string& error);
// Called when an unpacked extension has been loaded and installed.
- void OnLoaded(const scoped_refptr<const Extension>& extension);
+ void OnLoaded();
// Helper to get the Extension::CreateFlags for the installing extension.
int GetFlags();
@@ -89,6 +100,10 @@ class UnpackedInstaller
// loading.
bool prompt_for_plugins_;
+ scoped_ptr<RequirementsChecker> requirements_checker_;
+
+ scoped_refptr<const Extension> extension_;
+
// Whether to require the extension installed to have a modern manifest
// version.
bool require_modern_manifest_version_;