diff options
author | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 03:57:47 +0000 |
---|---|---|
committer | mazda@chromium.org <mazda@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-14 03:57:47 +0000 |
commit | 1c741b888324973516cb330620853c5a1e396d40 (patch) | |
tree | b7ba99e246c3a0b5838e3741f0b14da9bcb68abf /chrome/browser/chromeos | |
parent | e60e47ad57e7ff423c39cff9c88725a7aed85118 (diff) | |
download | chromium_src-1c741b888324973516cb330620853c5a1e396d40.zip chromium_src-1c741b888324973516cb330620853c5a1e396d40.tar.gz chromium_src-1c741b888324973516cb330620853c5a1e396d40.tar.bz2 |
Add a DOM UI version of ibus-hangul configuration dialog.
This dialog cannot be opend from UI yet.
The execution path will be added once "Languages and Input" dialog is ready.
TEST=manually check on the netbook by uncommenting TODO lines.
BUG=chromium-os:4806
Review URL: http://codereview.chromium.org/2853032
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52279 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos')
3 files changed, 72 insertions, 5 deletions
diff --git a/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.cc b/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.cc new file mode 100644 index 0000000..150ae15 --- /dev/null +++ b/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.cc @@ -0,0 +1,39 @@ +// Copyright (c) 2010 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/chromeos/dom_ui/language_hangul_options_handler.h" + +#include "app/l10n_util.h" +#include "base/values.h" +#include "chrome/browser/chromeos/language_preferences.h" +#include "grit/generated_resources.h" + +LanguageHangulOptionsHandler::LanguageHangulOptionsHandler() { +} + +LanguageHangulOptionsHandler::~LanguageHangulOptionsHandler() { +} + +void LanguageHangulOptionsHandler::GetLocalizedValues( + DictionaryValue* localized_strings) { + DCHECK(localized_strings); + // Language Hangul page - ChromeOS + localized_strings->SetString(L"keyboard_layout", + l10n_util::GetString(IDS_OPTIONS_SETTINGS_KEYBOARD_LAYOUT_TEXT)); + + localized_strings->Set(L"keyboardLayoutList", GetKeyboardLayoutList()); +} + +ListValue* LanguageHangulOptionsHandler::GetKeyboardLayoutList() { + ListValue* keyboard_layout_list = new ListValue(); + for (size_t i = 0; i < arraysize(chromeos::kHangulKeyboardNameIDPairs); ++i) { + ListValue* option = new ListValue(); + option->Append(Value::CreateStringValue(ASCIIToWide( + chromeos::kHangulKeyboardNameIDPairs[i].keyboard_id))); + option->Append(Value::CreateStringValue(l10n_util::GetString( + chromeos::kHangulKeyboardNameIDPairs[i].message_id))); + keyboard_layout_list->Append(option); + } + return keyboard_layout_list; +} diff --git a/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.h b/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.h new file mode 100644 index 0000000..1872fbc --- /dev/null +++ b/chrome/browser/chromeos/dom_ui/language_hangul_options_handler.h @@ -0,0 +1,29 @@ +// Copyright (c) 2010 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. + +#ifndef CHROME_BROWSER_CHROMEOS_DOM_UI_LANGUAGE_HANGUL_OPTIONS_HANDLER_H_ +#define CHROME_BROWSER_CHROMEOS_DOM_UI_LANGUAGE_HANGUL_OPTIONS_HANDLER_H_ + +#include "chrome/browser/dom_ui/options_ui.h" + +class DictionaryValue; +class ListValue; + +// Hangul options page UI handler. +class LanguageHangulOptionsHandler : public OptionsPageUIHandler { + public: + LanguageHangulOptionsHandler(); + virtual ~LanguageHangulOptionsHandler(); + + // OptionsUIHandler implementation. + virtual void GetLocalizedValues(DictionaryValue* localized_strings); + + private: + // Returns the list of hangul keyboards. + static ListValue* GetKeyboardLayoutList(); + + DISALLOW_COPY_AND_ASSIGN(LanguageHangulOptionsHandler); +}; + +#endif // CHROME_BROWSER_CHROMEOS_DOM_UI_LANGUAGE_HANGUL_OPTIONS_HANDLER_H_ diff --git a/chrome/browser/chromeos/dom_ui/system_options_handler.cc b/chrome/browser/chromeos/dom_ui/system_options_handler.cc index fed9222..b280526 100644 --- a/chrome/browser/chromeos/dom_ui/system_options_handler.cc +++ b/chrome/browser/chromeos/dom_ui/system_options_handler.cc @@ -107,11 +107,10 @@ ListValue* SystemOptionsHandler::GetTimezoneList() { for (std::vector<icu::TimeZone*>::iterator iter = timezones_.begin(); iter != timezones_.end(); ++iter) { const icu::TimeZone* timezone = *iter; - static const std::wstring delimiter(L"|"); - std::wstring value = GetTimezoneID(timezone); - value += delimiter; - value += GetTimezoneName(timezone); - timezoneList->Append(Value::CreateStringValue(value)); + ListValue* option = new ListValue(); + option->Append(Value::CreateStringValue(GetTimezoneID(timezone))); + option->Append(Value::CreateStringValue(GetTimezoneName(timezone))); + timezoneList->Append(option); } return timezoneList; } |