summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/language_preferences.h6
-rw-r--r--chrome/browser/chromeos/preferences.cc7
-rw-r--r--chrome/browser/chromeos/preferences.h1
3 files changed, 14 insertions, 0 deletions
diff --git a/chrome/browser/chromeos/language_preferences.h b/chrome/browser/chromeos/language_preferences.h
index f9244d4..e621742 100644
--- a/chrome/browser/chromeos/language_preferences.h
+++ b/chrome/browser/chromeos/language_preferences.h
@@ -151,6 +151,12 @@ const LanguageMultipleChoicePreference<int> kChewingHsuSelKeyType = {
// For Korean input method (ibus-hangul)
const char kHangulSectionName[] = "engine/Hangul";
const char kHangulKeyboardConfigName[] = "HangulKeyboard";
+const char kHangulHanjaKeysConfigName[] = "HanjaKeys";
+// We add Control+Alt+9 in addition to the two default keys since Hanja key
+// might not be available on the Chrome OS keyboard and F9 key is reserved by
+// the window manager.
+// TODO: Hanja keys are not configurable yet (and we're not sure if it should.)
+const char kHangulHanjaKeys[] = "F9,Hangul_Hanja,Control+Alt+9";
const struct HangulKeyboardNameIDPair {
int message_id;
diff --git a/chrome/browser/chromeos/preferences.cc b/chrome/browser/chromeos/preferences.cc
index 1094b97..0fe3b48 100644
--- a/chrome/browser/chromeos/preferences.cc
+++ b/chrome/browser/chromeos/preferences.cc
@@ -57,6 +57,7 @@ void Preferences::RegisterUserPrefs(PrefService* prefs) {
prefs->RegisterStringPref(
prefs::kLanguageHangulKeyboard,
kHangulKeyboardNameIDPairs[0].keyboard_id);
+ prefs->RegisterStringPref(prefs::kLanguageHangulHanjaKeys, kHangulHanjaKeys);
for (size_t i = 0; i < kNumPinyinBooleanPrefs; ++i) {
prefs->RegisterBooleanPref(kPinyinBooleanPrefs[i].pref_name,
kPinyinBooleanPrefs[i].default_pref_value);
@@ -109,6 +110,8 @@ void Preferences::Init(PrefService* prefs) {
kChewingIntegerPrefs[i].pref_name, prefs, this);
}
language_hangul_keyboard_.Init(prefs::kLanguageHangulKeyboard, prefs, this);
+ language_hangul_hanja_keys_.Init(
+ prefs::kLanguageHangulHanjaKeys, prefs, this);
for (size_t i = 0; i < kNumPinyinBooleanPrefs; ++i) {
language_pinyin_boolean_prefs_[i].Init(
kPinyinBooleanPrefs[i].pref_name, prefs, this);
@@ -232,6 +235,10 @@ void Preferences::NotifyPrefChanged(const std::wstring* pref_name) {
SetLanguageConfigString(kHangulSectionName, kHangulKeyboardConfigName,
language_hangul_keyboard_.GetValue());
}
+ if (!pref_name || *pref_name == prefs::kLanguageHangulHanjaKeys) {
+ SetLanguageConfigString(kHangulSectionName, kHangulHanjaKeysConfigName,
+ language_hangul_hanja_keys_.GetValue());
+ }
for (size_t i = 0; i < kNumPinyinBooleanPrefs; ++i) {
if (!pref_name || *pref_name == kPinyinBooleanPrefs[i].pref_name) {
SetLanguageConfigBoolean(kPinyinSectionName,
diff --git a/chrome/browser/chromeos/preferences.h b/chrome/browser/chromeos/preferences.h
index 81c1f8c..e0b93fc 100644
--- a/chrome/browser/chromeos/preferences.h
+++ b/chrome/browser/chromeos/preferences.h
@@ -90,6 +90,7 @@ class Preferences : public NotificationObserver {
IntegerPrefMember language_chewing_hsu_sel_key_type_;
IntegerPrefMember language_chewing_integer_prefs_[kNumChewingIntegerPrefs];
StringPrefMember language_hangul_keyboard_;
+ StringPrefMember language_hangul_hanja_keys_;
BooleanPrefMember language_pinyin_boolean_prefs_[kNumPinyinBooleanPrefs];
IntegerPrefMember language_pinyin_int_prefs_[kNumPinyinIntegerPrefs];
IntegerPrefMember language_pinyin_double_pinyin_schema_;