OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
11 #include "base/values.h" | 11 #include "base/values.h" |
12 #include "chrome/browser/chromeos/language_preferences.h" | 12 #include "chrome/browser/chromeos/language_preferences.h" |
13 #include "ui/base/l10n/l10n_util.h" | 13 #include "ui/base/l10n/l10n_util.h" |
14 | 14 |
15 namespace base { | 15 namespace base { |
16 class ListValue; | 16 class ListValue; |
17 } | 17 } |
18 | 18 |
19 namespace chromeos { | 19 namespace chromeos { |
20 namespace options2 { | 20 namespace options { |
21 | 21 |
22 // Returns an i18n-content value corresponding to |preference|. | 22 // Returns an i18n-content value corresponding to |preference|. |
23 template <typename T> | 23 template <typename T> |
24 std::string GetI18nContentValue(const T& preference, const char* prefix) { | 24 std::string GetI18nContentValue(const T& preference, const char* prefix) { |
25 return std::string(prefix) + preference.ibus_config_name; | 25 return std::string(prefix) + preference.ibus_config_name; |
26 } | 26 } |
27 | 27 |
28 // Returns a property name of templateData corresponding to |preference|. | 28 // Returns a property name of templateData corresponding to |preference|. |
29 template <typename T> | 29 template <typename T> |
30 std::string GetTemplateDataPropertyName(const T& preference, | 30 std::string GetTemplateDataPropertyName(const T& preference, |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 base::ListValue* option = new base::ListValue(); | 71 base::ListValue* option = new base::ListValue(); |
72 option->Append(CreateValue( | 72 option->Append(CreateValue( |
73 preference.values_and_ids[i].ibus_config_value)); | 73 preference.values_and_ids[i].ibus_config_value)); |
74 option->Append(base::Value::CreateStringValue(l10n_util::GetStringUTF16( | 74 option->Append(base::Value::CreateStringValue(l10n_util::GetStringUTF16( |
75 preference.values_and_ids[i].item_message_id))); | 75 preference.values_and_ids[i].item_message_id))); |
76 list_value->Append(option); | 76 list_value->Append(option); |
77 } | 77 } |
78 return list_value; | 78 return list_value; |
79 } | 79 } |
80 | 80 |
81 } // namespace options2 | 81 } // namespace options |
82 } // namespace chromeos | 82 } // namespace chromeos |
83 | 83 |
84 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ | 84 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_CHROMEOS_LANGUAGE_OPTIONS_UTIL_H_ |
OLD | NEW |