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