Marc-Antoine Courteau | 311a7cec | 2017-12-14 21:18:49 | [diff] [blame] | 1 | // Copyright 2017 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_SPELLCHECKER_SPELLCHECK_LANGUAGE_POLICY_HANDLER_H_ |
| 6 | #define CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_LANGUAGE_POLICY_HANDLER_H_ |
| 7 | |
Guillaume Jenkins | f9cf4e3 | 2019-03-12 19:54:55 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
Marc-Antoine Courteau | 311a7cec | 2017-12-14 21:18:49 | [diff] [blame] | 10 | #include "base/macros.h" |
| 11 | #include "components/policy/core/browser/configuration_policy_handler.h" |
| 12 | |
| 13 | // ConfigurationPolicyHandler for the SpellcheckLanguage policy. |
| 14 | class SpellcheckLanguagePolicyHandler |
| 15 | : public policy::TypeCheckingPolicyHandler { |
| 16 | public: |
| 17 | SpellcheckLanguagePolicyHandler(); |
Peter Boström | 53c6c595 | 2021-09-17 09:41:26 | [diff] [blame^] | 18 | |
| 19 | SpellcheckLanguagePolicyHandler(const SpellcheckLanguagePolicyHandler&) = |
| 20 | delete; |
| 21 | SpellcheckLanguagePolicyHandler& operator=( |
| 22 | const SpellcheckLanguagePolicyHandler&) = delete; |
| 23 | |
Marc-Antoine Courteau | 311a7cec | 2017-12-14 21:18:49 | [diff] [blame] | 24 | ~SpellcheckLanguagePolicyHandler() override; |
| 25 | |
| 26 | // ConfigurationPolicyHandler: |
| 27 | bool CheckPolicySettings(const policy::PolicyMap& policies, |
| 28 | policy::PolicyErrorMap* errors) override; |
| 29 | void ApplyPolicySettings(const policy::PolicyMap& policies, |
| 30 | PrefValueMap* prefs) override; |
| 31 | |
| 32 | private: |
Guillaume Jenkins | f9cf4e3 | 2019-03-12 19:54:55 | [diff] [blame] | 33 | void SortForcedLanguages(const policy::PolicyMap& policies, |
| 34 | std::vector<base::Value>* const forced, |
| 35 | std::vector<std::string>* const unknown); |
Marc-Antoine Courteau | 311a7cec | 2017-12-14 21:18:49 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | #endif // CHROME_BROWSER_SPELLCHECKER_SPELLCHECK_LANGUAGE_POLICY_HANDLER_H_ |