Index: chromeos/network/policy_util.h |
diff --git a/chromeos/ime/input_method_whitelist.h b/chromeos/network/policy_util.h |
similarity index 19% |
copy from chromeos/ime/input_method_whitelist.h |
copy to chromeos/network/policy_util.h |
index 3a224936183d67c02c6e23417de1aa0381dcf468..c9313999335db8c44d7ce0ca5255f024d19bf4aa 100644 |
--- a/chromeos/ime/input_method_whitelist.h |
+++ b/chromeos/network/policy_util.h |
@@ -2,45 +2,46 @@ |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CHROMEOS_IME_INPUT_METHOD_WHITELIST_H_ |
-#define CHROMEOS_IME_INPUT_METHOD_WHITELIST_H_ |
+#ifndef CHROMEOS_NETWORK_POLICY_UTIL_H_ |
+#define CHROMEOS_NETWORK_POLICY_UTIL_H_ |
-#include <set> |
+#include <map> |
#include <string> |
-#include <vector> |
-#include "base/basictypes.h" |
#include "base/memory/scoped_ptr.h" |
-#include "chromeos/chromeos_export.h" |
+ |
+namespace base { |
+class DictionaryValue; |
+} |
namespace chromeos { |
-namespace input_method { |
-class InputMethodDescriptor; |
-typedef std::vector<InputMethodDescriptor> InputMethodDescriptors; |
+struct NetworkProfile; |
-// A class which has white listed input method list. The list is generated by |
-// gen_input_methods.py from input_methods.txt. |
-class CHROMEOS_EXPORT InputMethodWhitelist { |
- public: |
- InputMethodWhitelist(); |
- ~InputMethodWhitelist(); |
+namespace policy_util { |
- // Returns true if |input_method_id| is whitelisted. |
- bool InputMethodIdIsWhitelisted(const std::string& input_method_id) const; |
+typedef std::map<std::string, const base::DictionaryValue*> GuidToPolicyMap; |
- // Returns all input methods that are supported, including ones not active. |
- // This function never returns NULL. Note that input method extensions are not |
- // included in the result. |
- scoped_ptr<InputMethodDescriptors> GetSupportedInputMethods() const; |
+// Creates a Shill property dictionary from the given arguments. The resulting |
+// dictionary will be sent to Shill by the caller. Depending on the profile |
+// type, |policy| is interpreted as the user or device policy and |settings| as |
+// the user or shared settings. |policy| or |settings| can be NULL, but not |
+// both. |
+scoped_ptr<base::DictionaryValue> CreateShillConfiguration( |
+ const NetworkProfile& profile, |
+ const std::string& guid, |
+ const base::DictionaryValue* policy, |
+ const base::DictionaryValue* settings); |
- private: |
- std::set<std::string> supported_input_methods_; |
+// Returns the policy from |policies| matching |actual_network|, if any exists. |
+// Returns NULL otherwise. |actual_network| must be part of a ONC |
+// NetworkConfiguration. |
+const base::DictionaryValue* FindMatchingPolicy( |
+ const GuidToPolicyMap& policies, |
+ const base::DictionaryValue& actual_network); |
- DISALLOW_COPY_AND_ASSIGN(InputMethodWhitelist); |
-}; |
+} // namespace policy_util |
-} // namespace input_method |
} // namespace chromeos |
-#endif // CHROMEOS_IME_INPUT_METHOD_WHITELIST_H_ |
+#endif // CHROMEOS_NETWORK_POLICY_UTIL_H_ |