class InstallVerifier : public ManagementPolicy::Provider {
public:
InstallVerifier(ExtensionPrefs* prefs, content::BrowserContext* context);
- virtual ~InstallVerifier();
+ ~InstallVerifier() override;
// Returns whether |extension| is of a type that needs verification.
static bool NeedsVerification(const Extension& extension);
+ // Determines if an extension claims to be from the webstore.
+ static bool IsFromStore(const Extension& extension);
+
// Initializes this object for use, including reading preferences and
// validating the stored signature.
void Init();
// Returns true if |id| is either verified or our stored signature explicitly
// tells us that it was invalid when we asked the server about it.
- bool IsKnownId(const std::string& id);
+ bool IsKnownId(const std::string& id) const;
+
+ // Returns whether the given |id| is considered invalid by our verified
+ // signature.
+ bool IsInvalid(const std::string& id) const;
// Attempts to verify a single extension and add it to the verified list.
void VerifyExtension(const std::string& extension_id);
void Remove(const std::string& id);
void RemoveMany(const ExtensionIdSet& ids);
+ // Returns whether an extension id is allowed by policy.
+ bool AllowedByEnterprisePolicy(const std::string& id) const;
+
// ManagementPolicy::Provider interface.
- virtual std::string GetDebugPolicyProviderName() const OVERRIDE;
- virtual bool MustRemainDisabled(const Extension* extension,
- Extension::DisableReason* reason,
- base::string16* error) const OVERRIDE;
+ std::string GetDebugPolicyProviderName() const override;
+ bool MustRemainDisabled(const Extension* extension,
+ Extension::DisableReason* reason,
+ base::string16* error) const override;
private:
// We keep a list of operations to the current set of extensions.
// Removes any no-longer-installed ids, requesting a new signature if needed.
void GarbageCollect();
- // Returns whether an extension id is allowed by policy.
- bool AllowedByEnterprisePolicy(const std::string& id) const;
-
// Returns whether the given |id| is included in our verified signature.
bool IsVerified(const std::string& id) const;