Chromium Code Reviews| 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 class InstallVerifier : public ManagementPolicy::Provider { | 38 class InstallVerifier : public ManagementPolicy::Provider { |
| 39 public: | 39 public: |
| 40 InstallVerifier(ExtensionPrefs* prefs, | 40 InstallVerifier(ExtensionPrefs* prefs, |
| 41 net::URLRequestContextGetter* context_getter); | 41 net::URLRequestContextGetter* context_getter); |
| 42 virtual ~InstallVerifier(); | 42 virtual ~InstallVerifier(); |
| 43 | 43 |
| 44 // Initializes this object for use, including reading preferences and | 44 // Initializes this object for use, including reading preferences and |
| 45 // validating the stored signature. | 45 // validating the stored signature. |
| 46 void Init(); | 46 void Init(); |
| 47 | 47 |
| 48 // Do we need to be bootstrapped? (Ie do we have a signature already) | |
|
Finnur
2013/12/16 14:21:51
nit: s/Ie/i.e.
End with period.
asargent_no_longer_on_chrome
2013/12/16 18:47:10
Done.
| |
| 49 bool NeedsBootstrap(); | |
| 50 | |
| 48 // A callback for indicating success/failure of adding new ids. | 51 // A callback for indicating success/failure of adding new ids. |
| 49 typedef base::Callback<void(bool)> AddResultCallback; | 52 typedef base::Callback<void(bool)> AddResultCallback; |
| 50 | 53 |
| 51 // Try adding a new |id| (or set of ids) to the list of verified ids. When | 54 // Try adding a new |id| (or set of ids) to the list of verified ids. When |
| 52 // this process is finished |callback| will be run with success/failure. In | 55 // this process is finished |callback| will be run with success/failure of |
| 53 // case of success, subsequent calls to IsVerified will begin returning true | 56 // the signature request (not necessarily whether the ids were verified). |
| 54 // for |id|. | |
| 55 void Add(const std::string& id, const AddResultCallback& callback); | 57 void Add(const std::string& id, const AddResultCallback& callback); |
| 56 void AddMany(const ExtensionIdSet& ids, | 58 void AddMany(const ExtensionIdSet& ids, |
| 57 const AddResultCallback& callback); | 59 const AddResultCallback& callback); |
| 58 | 60 |
| 59 // Call this to add a set of ids that will immediately be considered allowed, | 61 // Call this to add a set of ids that will immediately be considered allowed, |
| 60 // and kick off an aysnchronous request to Add. | 62 // and kick off an aysnchronous request to Add. |
| 61 void AddProvisional(const ExtensionIdSet& ids); | 63 void AddProvisional(const ExtensionIdSet& ids); |
| 62 | 64 |
| 63 // Removes an id or set of ids from the verified list. | 65 // Removes an id or set of ids from the verified list. |
| 64 void Remove(const std::string& id); | 66 void Remove(const std::string& id); |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 127 // A set of ids that have been provisionally added, which we're willing to | 129 // A set of ids that have been provisionally added, which we're willing to |
| 128 // consider allowed until we hear back from the server signature request. | 130 // consider allowed until we hear back from the server signature request. |
| 129 ExtensionIdSet provisional_; | 131 ExtensionIdSet provisional_; |
| 130 | 132 |
| 131 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); | 133 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); |
| 132 }; | 134 }; |
| 133 | 135 |
| 134 } // namespace extensions | 136 } // namespace extensions |
| 135 | 137 |
| 136 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 138 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
| OLD | NEW |