Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5125)

Unified Diff: chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.cc

Issue 8895023: Options2: Pull the trigger. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: DIAF. Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.cc
diff --git a/chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.cc b/chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.cc
new file mode 100644
index 0000000000000000000000000000000000000000..8e2c19cef9f25f83f624047f2895e4d6aad77263
--- /dev/null
+++ b/chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.cc
@@ -0,0 +1,67 @@
+// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/ui/webui/options2/chromeos/language_pinyin_handler.h"
+
+#include "base/values.h"
+#include "chrome/browser/chromeos/language_preferences.h"
+#include "chrome/browser/ui/webui/options2/chromeos/language_options_util.h"
+#include "grit/generated_resources.h"
+#include "ui/base/l10n/l10n_util.h"
+
+namespace {
+const char kI18nPrefix[] = "Pinyin";
+} // namespace
+
+namespace chromeos {
+
+LanguagePinyinHandler::LanguagePinyinHandler() {
+}
+
+LanguagePinyinHandler::~LanguagePinyinHandler() {
+}
+
+void LanguagePinyinHandler::GetLocalizedValues(
+ DictionaryValue* localized_strings) {
+ DCHECK(localized_strings);
+
+ RegisterTitle(localized_strings, "languagePinyinPage",
+ IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTINGS_TITLE);
+
+ for (size_t i = 0; i < language_prefs::kNumPinyinBooleanPrefs; ++i) {
+ localized_strings->SetString(
+ GetI18nContentValue(language_prefs::kPinyinBooleanPrefs[i],
+ kI18nPrefix),
+ l10n_util::GetStringUTF16(
+ language_prefs::kPinyinBooleanPrefs[i].message_id));
+ }
+
+ localized_strings->SetString(
+ GetI18nContentValue(language_prefs::kPinyinDoublePinyinSchema,
+ kI18nPrefix),
+ l10n_util::GetStringUTF16(
+ language_prefs::kPinyinDoublePinyinSchema.label_message_id));
+ ListValue* list_value = new ListValue();
+ for (size_t i = 0;
+ i < language_prefs::LanguageMultipleChoicePreference<int>::kMaxItems;
+ ++i) {
+ if (language_prefs::kPinyinDoublePinyinSchema.values_and_ids[i].
+ item_message_id == 0)
+ break;
+ ListValue* option = new ListValue();
+ option->Append(Value::CreateIntegerValue(
+ language_prefs::kPinyinDoublePinyinSchema.values_and_ids[i].
+ ibus_config_value));
+ option->Append(Value::CreateStringValue(l10n_util::GetStringUTF16(
+ language_prefs::kPinyinDoublePinyinSchema.values_and_ids[i].
+ item_message_id)));
+ list_value->Append(option);
+ }
+ localized_strings->Set(
+ GetTemplateDataPropertyName(language_prefs::kPinyinDoublePinyinSchema,
+ kI18nPrefix),
+ list_value);
+}
+
+} // namespace chromeos

Powered by Google App Engine
This is Rietveld 408576698