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

Side by Side Diff: chrome/browser/extensions/policy_handlers.h

Issue 2509753006: Revert of Plumbing for login apps device policy to extensions. (Closed)
Patch Set: 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
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_
6 #define CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ 6 #define CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 policy::PolicyErrorMap* errors, 42 policy::PolicyErrorMap* errors,
43 std::unique_ptr<base::ListValue>* extension_ids); 43 std::unique_ptr<base::ListValue>* extension_ids);
44 44
45 private: 45 private:
46 const char* pref_path_; 46 const char* pref_path_;
47 bool allow_wildcards_; 47 bool allow_wildcards_;
48 48
49 DISALLOW_COPY_AND_ASSIGN(ExtensionListPolicyHandler); 49 DISALLOW_COPY_AND_ASSIGN(ExtensionListPolicyHandler);
50 }; 50 };
51 51
52 class ExtensionInstallListPolicyHandler 52 class ExtensionInstallForcelistPolicyHandler
53 : public policy::TypeCheckingPolicyHandler { 53 : public policy::TypeCheckingPolicyHandler {
54 public: 54 public:
55 ExtensionInstallForcelistPolicyHandler();
56 ~ExtensionInstallForcelistPolicyHandler() override;
57
55 // ConfigurationPolicyHandler methods: 58 // ConfigurationPolicyHandler methods:
56 bool CheckPolicySettings(const policy::PolicyMap& policies, 59 bool CheckPolicySettings(const policy::PolicyMap& policies,
57 policy::PolicyErrorMap* errors) override; 60 policy::PolicyErrorMap* errors) override;
58 void ApplyPolicySettings(const policy::PolicyMap& policies, 61 void ApplyPolicySettings(const policy::PolicyMap& policies,
59 PrefValueMap* prefs) override; 62 PrefValueMap* prefs) override;
60 63
61 protected:
62 ExtensionInstallListPolicyHandler(const char* policy_name,
63 const char* pref_name);
64
65 ~ExtensionInstallListPolicyHandler() override;
66
67 const char* pref_name() const { return pref_name_; }
68
69 private: 64 private:
70 // Parses the data in |policy_value| and writes them to |extension_dict|. 65 // Parses the data in |policy_value| and writes them to |extension_dict|.
71 bool ParseList(const base::Value* policy_value, 66 bool ParseList(const base::Value* policy_value,
72 base::DictionaryValue* extension_dict, 67 base::DictionaryValue* extension_dict,
73 policy::PolicyErrorMap* errors); 68 policy::PolicyErrorMap* errors);
74 69
75 const char* const pref_name_;
76
77 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallListPolicyHandler);
78 };
79
80 class ExtensionInstallForcelistPolicyHandler
81 : public ExtensionInstallListPolicyHandler {
82 public:
83 ExtensionInstallForcelistPolicyHandler();
84 ~ExtensionInstallForcelistPolicyHandler() override;
85
86 private:
87 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallForcelistPolicyHandler); 70 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallForcelistPolicyHandler);
88 }; 71 };
89 72
90 class ExtensionInstallSigninListPolicyHandler
91 : public ExtensionInstallListPolicyHandler {
92 public:
93 ExtensionInstallSigninListPolicyHandler();
94 ~ExtensionInstallSigninListPolicyHandler() override;
95
96 private:
97 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallSigninListPolicyHandler);
98 };
99
100 // Implements additional checks for policies that are lists of extension 73 // Implements additional checks for policies that are lists of extension
101 // URLPatterns. 74 // URLPatterns.
102 class ExtensionURLPatternListPolicyHandler 75 class ExtensionURLPatternListPolicyHandler
103 : public policy::TypeCheckingPolicyHandler { 76 : public policy::TypeCheckingPolicyHandler {
104 public: 77 public:
105 ExtensionURLPatternListPolicyHandler(const char* policy_name, 78 ExtensionURLPatternListPolicyHandler(const char* policy_name,
106 const char* pref_path); 79 const char* pref_path);
107 ~ExtensionURLPatternListPolicyHandler() override; 80 ~ExtensionURLPatternListPolicyHandler() override;
108 81
109 // ConfigurationPolicyHandler methods: 82 // ConfigurationPolicyHandler methods:
(...skipping 20 matching lines...) Expand all
130 void ApplyPolicySettings(const policy::PolicyMap& policies, 103 void ApplyPolicySettings(const policy::PolicyMap& policies,
131 PrefValueMap* prefs) override; 104 PrefValueMap* prefs) override;
132 105
133 private: 106 private:
134 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler); 107 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler);
135 }; 108 };
136 109
137 } // namespace extensions 110 } // namespace extensions
138 111
139 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ 112 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/external_provider_impl.cc ('k') | chrome/browser/extensions/policy_handlers.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698