| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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_INSTALL_VERIFIER_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
| 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
| 7 | 7 |
| 8 #include <queue> | 8 #include <queue> |
| 9 #include <set> | 9 #include <set> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 27 matching lines...) Expand all Loading... |
| 38 // written into the extension preferences and is checked for validity when | 38 // written into the extension preferences and is checked for validity when |
| 39 // being read back again. | 39 // being read back again. |
| 40 // | 40 // |
| 41 // This class should be kept notified of runtime changes to the set of | 41 // This class should be kept notified of runtime changes to the set of |
| 42 // extensions installed from the webstore. | 42 // extensions installed from the webstore. |
| 43 class InstallVerifier : public ManagementPolicy::Provider { | 43 class InstallVerifier : public ManagementPolicy::Provider { |
| 44 public: | 44 public: |
| 45 InstallVerifier(ExtensionPrefs* prefs, content::BrowserContext* context); | 45 InstallVerifier(ExtensionPrefs* prefs, content::BrowserContext* context); |
| 46 ~InstallVerifier() override; | 46 ~InstallVerifier() override; |
| 47 | 47 |
| 48 // Returns whether install verification should be enforced. |
| 49 static bool ShouldEnforce(); |
| 50 |
| 48 // Returns whether |extension| is of a type that needs verification. | 51 // Returns whether |extension| is of a type that needs verification. |
| 49 static bool NeedsVerification(const Extension& extension); | 52 static bool NeedsVerification(const Extension& extension); |
| 50 | 53 |
| 51 // Determines if an extension claims to be from the webstore. | 54 // Determines if an extension claims to be from the webstore. |
| 52 static bool IsFromStore(const Extension& extension); | 55 static bool IsFromStore(const Extension& extension); |
| 53 | 56 |
| 54 // Initializes this object for use, including reading preferences and | 57 // Initializes this object for use, including reading preferences and |
| 55 // validating the stored signature. | 58 // validating the stored signature. |
| 56 void Init(); | 59 void Init(); |
| 57 | 60 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 ExtensionIdSet provisional_; | 172 ExtensionIdSet provisional_; |
| 170 | 173 |
| 171 base::WeakPtrFactory<InstallVerifier> weak_factory_; | 174 base::WeakPtrFactory<InstallVerifier> weak_factory_; |
| 172 | 175 |
| 173 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); | 176 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); |
| 174 }; | 177 }; |
| 175 | 178 |
| 176 } // namespace extensions | 179 } // namespace extensions |
| 177 | 180 |
| 178 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 181 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
| OLD | NEW |