Rename GetIconID to GetIconId
[chromium-blink-merge.git] / chrome / browser / extensions / chrome_content_verifier_delegate.h
blob4104f56c96105aef9fa79f6a2ea1adca324603d0
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_VERIFIER_DELEGATE_H_
6 #define CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_VERIFIER_DELEGATE_H_
8 #include "extensions/browser/content_verifier_delegate.h"
10 namespace content {
11 class BrowserContext;
14 namespace extensions {
16 class ChromeContentVerifierDelegate : public ContentVerifierDelegate {
17 public:
18 static Mode GetDefaultMode();
20 explicit ChromeContentVerifierDelegate(content::BrowserContext* context);
22 ~ChromeContentVerifierDelegate() override;
24 // ContentVerifierDelegate:
25 Mode ShouldBeVerified(const Extension& extension) override;
26 ContentVerifierKey GetPublicKey() override;
27 GURL GetSignatureFetchUrl(const std::string& extension_id,
28 const base::Version& version) override;
29 std::set<base::FilePath> GetBrowserImagePaths(
30 const extensions::Extension* extension) override;
31 void VerifyFailed(const std::string& extension_id,
32 ContentVerifyJob::FailureReason reason) override;
34 private:
35 void LogFailureForPolicyForceInstall(const std::string& extension_id);
37 content::BrowserContext* context_;
38 ContentVerifierDelegate::Mode default_mode_;
40 // For reporting metrics in BOOTSTRAP mode, when an extension would be
41 // disabled if content verification was in ENFORCE mode.
42 std::set<std::string> would_be_disabled_ids_;
44 // Currently enterprise policy extensions that must remain enabled will not
45 // be disabled due to content verification failure, but we are considering
46 // changing this (crbug.com/447040), so for now we are tracking how often
47 // this happens to help inform the decision.
48 std::set<std::string> corrupt_policy_extensions_;
50 DISALLOW_COPY_AND_ASSIGN(ChromeContentVerifierDelegate);
53 } // namespace extensions
55 #endif // CHROME_BROWSER_EXTENSIONS_CHROME_CONTENT_VERIFIER_DELEGATE_H_