OLD | NEW |
(Empty) | |
| 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 EXTENSIONS_BROWSER_POLICY_CHECK_H_ |
| 6 #define EXTENSIONS_BROWSER_POLICY_CHECK_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "base/strings/string16.h" |
| 10 #include "extensions/browser/preload_check.h" |
| 11 |
| 12 namespace content { |
| 13 class BrowserContext; |
| 14 } |
| 15 |
| 16 namespace extensions { |
| 17 |
| 18 class Extension; |
| 19 |
| 20 // Checks whether loading this extension is disabled by policy. Synchronously |
| 21 // calls the callback with the result. |
| 22 class PolicyCheck : public PreloadCheck { |
| 23 public: |
| 24 PolicyCheck(content::BrowserContext* context, |
| 25 scoped_refptr<const Extension> extension); |
| 26 ~PolicyCheck() override; |
| 27 |
| 28 // PreloadCheck: |
| 29 void Start(ResultCallback callback) override; |
| 30 base::string16 GetErrorMessage() const override; |
| 31 |
| 32 private: |
| 33 content::BrowserContext* context_; |
| 34 base::string16 error_; |
| 35 |
| 36 DISALLOW_COPY_AND_ASSIGN(PolicyCheck); |
| 37 }; |
| 38 |
| 39 } // namespace extensions |
| 40 |
| 41 #endif // EXTENSIONS_BROWSER_POLICY_CHECK_H_ |
OLD | NEW |