Chromium Code Reviews| 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, const Extension* extension); | |
| 25 ~PolicyCheck() override; | |
| 26 | |
| 27 // PreloadCheck: | |
| 28 void Start(ResultCallback callback) override; | |
| 29 bool GetErrorMessage(base::string16* error) const override; | |
| 30 | |
| 31 private: | |
| 32 content::BrowserContext* context_; | |
| 33 mutable base::string16 error_; | |
|
Devlin
2017/03/08 03:01:45
why not just un-constify GetErrorMessage?
michaelpg
2017/03/09 01:53:30
GetErrorMessage shouldn't modify logical state. Bu
| |
| 34 | |
| 35 DISALLOW_COPY_AND_ASSIGN(PolicyCheck); | |
| 36 }; | |
| 37 | |
| 38 } // namespace extensions | |
| 39 | |
| 40 #endif // EXTENSIONS_BROWSER_POLICY_CHECK_H_ | |
| OLD | NEW |