michaelpg | c0145e6 | 2017-03-18 03:00:15 | [diff] [blame] | 1 | // Copyright 2017 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. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_ |
| 6 | #define CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_ |
| 7 | |
| 8 | #include "base/macros.h" |
| 9 | #include "base/memory/weak_ptr.h" |
| 10 | #include "extensions/browser/blacklist_state.h" |
| 11 | #include "extensions/browser/preload_check.h" |
| 12 | |
| 13 | namespace extensions { |
| 14 | |
| 15 | class Blacklist; |
| 16 | class Extension; |
| 17 | |
| 18 | // Asynchronously checks whether the extension is blacklisted. |
| 19 | class BlacklistCheck : public PreloadCheck { |
| 20 | public: |
| 21 | BlacklistCheck(Blacklist* blacklist, |
| 22 | scoped_refptr<const Extension> extension); |
| 23 | ~BlacklistCheck() override; |
| 24 | |
| 25 | // PreloadCheck: |
| 26 | void Start(ResultCallback callback) override; |
| 27 | |
| 28 | private: |
| 29 | void OnBlacklistedStateRetrieved(BlacklistState blacklist_state); |
| 30 | |
| 31 | Blacklist* blacklist_; |
| 32 | ResultCallback callback_; |
Jeremy Roman | 495db68 | 2019-07-12 16:03:24 | [diff] [blame] | 33 | base::WeakPtrFactory<BlacklistCheck> weak_ptr_factory_{this}; |
michaelpg | c0145e6 | 2017-03-18 03:00:15 | [diff] [blame] | 34 | |
| 35 | DISALLOW_COPY_AND_ASSIGN(BlacklistCheck); |
| 36 | }; |
| 37 | |
| 38 | } // namespace extensions |
| 39 | |
| 40 | #endif // CHROME_BROWSER_EXTENSIONS_BLACKLIST_CHECK_H_ |