| 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> |
| 9 |
| 8 #include "base/macros.h" | 10 #include "base/macros.h" |
| 9 #include "base/memory/scoped_ptr.h" | |
| 10 #include "base/values.h" | 11 #include "base/values.h" |
| 11 #include "components/policy/core/browser/configuration_policy_handler.h" | 12 #include "components/policy/core/browser/configuration_policy_handler.h" |
| 12 | 13 |
| 13 namespace policy { | 14 namespace policy { |
| 14 class PolicyMap; | 15 class PolicyMap; |
| 15 class PolicyErrorMap; | 16 class PolicyErrorMap; |
| 16 class Schema; | 17 class Schema; |
| 17 } // namespace policy | 18 } // namespace policy |
| 18 | 19 |
| 19 namespace extensions { | 20 namespace extensions { |
| (...skipping 12 matching lines...) Expand all Loading... |
| 32 policy::PolicyErrorMap* errors) override; | 33 policy::PolicyErrorMap* errors) override; |
| 33 void ApplyPolicySettings(const policy::PolicyMap& policies, | 34 void ApplyPolicySettings(const policy::PolicyMap& policies, |
| 34 PrefValueMap* prefs) override; | 35 PrefValueMap* prefs) override; |
| 35 | 36 |
| 36 protected: | 37 protected: |
| 37 const char* pref_path() const; | 38 const char* pref_path() const; |
| 38 | 39 |
| 39 // Runs sanity checks on the policy value and returns it in |extension_ids|. | 40 // Runs sanity checks on the policy value and returns it in |extension_ids|. |
| 40 bool CheckAndGetList(const policy::PolicyMap& policies, | 41 bool CheckAndGetList(const policy::PolicyMap& policies, |
| 41 policy::PolicyErrorMap* errors, | 42 policy::PolicyErrorMap* errors, |
| 42 scoped_ptr<base::ListValue>* extension_ids); | 43 std::unique_ptr<base::ListValue>* extension_ids); |
| 43 | 44 |
| 44 private: | 45 private: |
| 45 const char* pref_path_; | 46 const char* pref_path_; |
| 46 bool allow_wildcards_; | 47 bool allow_wildcards_; |
| 47 | 48 |
| 48 DISALLOW_COPY_AND_ASSIGN(ExtensionListPolicyHandler); | 49 DISALLOW_COPY_AND_ASSIGN(ExtensionListPolicyHandler); |
| 49 }; | 50 }; |
| 50 | 51 |
| 51 class ExtensionInstallForcelistPolicyHandler | 52 class ExtensionInstallForcelistPolicyHandler |
| 52 : public policy::TypeCheckingPolicyHandler { | 53 : public policy::TypeCheckingPolicyHandler { |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 void ApplyPolicySettings(const policy::PolicyMap& policies, | 103 void ApplyPolicySettings(const policy::PolicyMap& policies, |
| 103 PrefValueMap* prefs) override; | 104 PrefValueMap* prefs) override; |
| 104 | 105 |
| 105 private: | 106 private: |
| 106 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler); | 107 DISALLOW_COPY_AND_ASSIGN(ExtensionSettingsPolicyHandler); |
| 107 }; | 108 }; |
| 108 | 109 |
| 109 } // namespace extensions | 110 } // namespace extensions |
| 110 | 111 |
| 111 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ | 112 #endif // CHROME_BROWSER_EXTENSIONS_POLICY_HANDLERS_H_ |
| OLD | NEW |