Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2016 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_CHROMEOS_EXTENSIONS_SIGNIN_SCREEN_POLICY_PROVIDER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_EXTENSIONS_SIGNIN_SCREEN_POLICY_PROVIDER_H_ | |
| 7 | |
| 8 #include <string> | |
| 9 | |
| 10 #include "base/macros.h" | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "extensions/browser/management_policy.h" | |
| 13 #include "extensions/common/extension.h" | |
| 14 | |
| 15 namespace chromeos { | |
| 16 | |
| 17 // A managed policy that guards which extensions can be loaded on | |
| 18 // sign-in screen. | |
| 19 class SigninScreenPolicyProvider | |
| 20 : public extensions::ManagementPolicy::Provider { | |
| 21 public: | |
| 22 SigninScreenPolicyProvider(); | |
| 23 ~SigninScreenPolicyProvider() override; | |
| 24 | |
| 25 // extensions::ManagementPolicy::Provider: | |
| 26 std::string GetDebugPolicyProviderName() const override; | |
| 27 bool UserMayLoad(const extensions::Extension* extension, | |
| 28 base::string16* error) const override; | |
| 29 | |
| 30 private: | |
| 31 DISALLOW_COPY_AND_ASSIGN(SigninScreenPolicyProvider); | |
| 32 }; | |
| 33 | |
| 34 // Allows to bypass SigninScreenPolicyProvider checks. Use for tests. | |
| 35 class ScopedSigninScreenPolicyProviderDisabler { | |
|
emaxx
2016/11/11 16:11:37
Can this be suffixed with "ForTesting", to ensure
Devlin
2016/11/11 16:35:08
Drive by - we could also just have a method that r
Denis Kuznetsov (DE-MUC)
2016/11/11 21:26:33
Done.
| |
| 36 public: | |
| 37 ScopedSigninScreenPolicyProviderDisabler(); | |
| 38 ~ScopedSigninScreenPolicyProviderDisabler(); | |
| 39 | |
| 40 private: | |
| 41 bool original_flag_; | |
| 42 | |
| 43 DISALLOW_COPY_AND_ASSIGN(ScopedSigninScreenPolicyProviderDisabler); | |
| 44 }; | |
| 45 | |
| 46 } // namespace chromeos | |
| 47 | |
| 48 #endif // CHROME_BROWSER_CHROMEOS_EXTENSIONS_SIGNIN_SCREEN_POLICY_PROVIDER_H_ | |
| OLD | NEW |