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 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
49 void Init(); | 49 void Init(); |
50 | 50 |
51 // Do we need to be bootstrapped? (i.e. do we have a signature already). If | 51 // Do we need to be bootstrapped? (i.e. do we have a signature already). If |
52 // this is true, then consumers of this class should use Add/AddMany to get | 52 // this is true, then consumers of this class should use Add/AddMany to get |
53 // an initial one so that MustRemainDisabled can actually check against it. | 53 // an initial one so that MustRemainDisabled can actually check against it. |
54 bool NeedsBootstrap(); | 54 bool NeedsBootstrap(); |
55 | 55 |
56 // Returns the timestamp of our InstallSignature, if we have one. | 56 // Returns the timestamp of our InstallSignature, if we have one. |
57 base::Time SignatureTimestamp(); | 57 base::Time SignatureTimestamp(); |
58 | 58 |
| 59 // Returns true if |id| is either verified or our stored signature explicitly |
| 60 // tells us that it was invalid when we asked the server about it. |
| 61 bool IsKnownId(const std::string& id); |
| 62 |
59 // A callback for indicating success/failure of adding new ids. | 63 // A callback for indicating success/failure of adding new ids. |
60 typedef base::Callback<void(bool)> AddResultCallback; | 64 typedef base::Callback<void(bool)> AddResultCallback; |
61 | 65 |
62 // Try adding a new |id| (or set of ids) to the list of verified ids. When | 66 // Try adding a new |id| (or set of ids) to the list of verified ids. When |
63 // this process is finished |callback| will be run with success/failure of | 67 // this process is finished |callback| will be run with success/failure of |
64 // the signature request (not necessarily whether the ids were verified). | 68 // the signature request (not necessarily whether the ids were verified). |
65 void Add(const std::string& id, const AddResultCallback& callback); | 69 void Add(const std::string& id, const AddResultCallback& callback); |
66 void AddMany(const ExtensionIdSet& ids, | 70 void AddMany(const ExtensionIdSet& ids, |
67 const AddResultCallback& callback); | 71 const AddResultCallback& callback); |
68 | 72 |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
141 // A set of ids that have been provisionally added, which we're willing to | 145 // A set of ids that have been provisionally added, which we're willing to |
142 // consider allowed until we hear back from the server signature request. | 146 // consider allowed until we hear back from the server signature request. |
143 ExtensionIdSet provisional_; | 147 ExtensionIdSet provisional_; |
144 | 148 |
145 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); | 149 DISALLOW_COPY_AND_ASSIGN(InstallVerifier); |
146 }; | 150 }; |
147 | 151 |
148 } // namespace extensions | 152 } // namespace extensions |
149 | 153 |
150 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ | 154 #endif // CHROME_BROWSER_EXTENSIONS_INSTALL_VERIFIER_H_ |
OLD | NEW |