Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(51)

Side by Side Diff: chrome/browser/chromeos/extensions/signin_screen_policy_provider.h

Issue 2159103006: Add policy provider that would filter extensions/apps allowed on the (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a way to bypass checks for tests Created 4 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698