Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 ExtensionInstallForcelistPolicyHandler | 52 class ExtensionInstallListPolicyHandler |
| 53 : public policy::TypeCheckingPolicyHandler { | 53 : public policy::TypeCheckingPolicyHandler { |
| 54 public: | 54 public: |
| 55 ExtensionInstallForcelistPolicyHandler(); | |
| 56 ~ExtensionInstallForcelistPolicyHandler() override; | |
| 57 | |
| 58 // ConfigurationPolicyHandler methods: | 55 // ConfigurationPolicyHandler methods: |
| 59 bool CheckPolicySettings(const policy::PolicyMap& policies, | 56 bool CheckPolicySettings(const policy::PolicyMap& policies, |
| 60 policy::PolicyErrorMap* errors) override; | 57 policy::PolicyErrorMap* errors) override; |
| 61 void ApplyPolicySettings(const policy::PolicyMap& policies, | 58 void ApplyPolicySettings(const policy::PolicyMap& policies, |
| 62 PrefValueMap* prefs) override; | 59 PrefValueMap* prefs) override; |
| 63 | 60 |
| 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_; } | |
|
Devlin
2017/03/01 16:15:00
Is this needed?
| |
| 68 | |
| 64 private: | 69 private: |
| 65 // Parses the data in |policy_value| and writes them to |extension_dict|. | 70 // Parses the data in |policy_value| and writes them to |extension_dict|. |
| 66 bool ParseList(const base::Value* policy_value, | 71 bool ParseList(const base::Value* policy_value, |
| 67 base::DictionaryValue* extension_dict, | 72 base::DictionaryValue* extension_dict, |
| 68 policy::PolicyErrorMap* errors); | 73 policy::PolicyErrorMap* errors); |
| 69 | 74 |
| 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: | |
| 70 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallForcelistPolicyHandler); | 87 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallForcelistPolicyHandler); |
| 71 }; | 88 }; |
| 72 | 89 |
| 90 class ExtensionInstallSigninListPolicyHandler | |
| 91 : public ExtensionInstallListPolicyHandler { | |
| 92 public: | |
| 93 ExtensionInstallSigninListPolicyHandler(); | |
| 94 ~ExtensionInstallSigninListPolicyHandler() override; | |
| 95 | |
| 96 private: | |
| 97 DISALLOW_COPY_AND_ASSIGN(ExtensionInstallSigninListPolicyHandler); | |
| 98 }; | |
| 99 | |
| 73 // Implements additional checks for policies that are lists of extension | 100 // Implements additional checks for policies that are lists of extension |
| 74 // URLPatterns. | 101 // URLPatterns. |
| 75 class ExtensionURLPatternListPolicyHandler | 102 class ExtensionURLPatternListPolicyHandler |
| 76 : public policy::TypeCheckingPolicyHandler { | 103 : public policy::TypeCheckingPolicyHandler { |
| 77 public: | 104 public: |
| 78 ExtensionURLPatternListPolicyHandler(const char* policy_name, | 105 ExtensionURLPatternListPolicyHandler(const char* policy_name, |
| 79 const char* pref_path); | 106 const char* pref_path); |
| 80 ~ExtensionURLPatternListPolicyHandler() override; | 107 ~ExtensionURLPatternListPolicyHandler() override; |
| 81 | 108 |
| 82 // ConfigurationPolicyHandler methods: | 109 // ConfigurationPolicyHandler methods: |
| (...skipping 20 matching lines...) Expand all Loading... | |
| 103 void ApplyPolicySettings(const policy::PolicyMap& policies, | 130 void ApplyPolicySettings(const policy::PolicyMap& policies, |
| 104 PrefValueMap* prefs) override; | 131 PrefValueMap* prefs) override; |
| 105 | 132 |
| 106 private: | 133 private: |
| 107 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler); | 134 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler); |
| 108 }; | 135 }; |
| 109 | 136 |
| 110 } // namespace extensions | 137 } // namespace extensions |
| 111 | 138 |
| 112 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ | 139 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ |
| OLD | NEW |