summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 05:52:23 +0000
committeryusukes@google.com <yusukes@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-06 05:52:23 +0000
commit6e094094ed8b96e68b30e8628e8a169719edda27 (patch)
treed9503520e9e025ce63bc8daf3627a6997483a0a8
parent41732477840059cbdc2518e5095baf0875a81460 (diff)
downloadchromium_src-6e094094ed8b96e68b30e8628e8a169719edda27.zip
chromium_src-6e094094ed8b96e68b30e8628e8a169719edda27.tar.gz
chromium_src-6e094094ed8b96e68b30e8628e8a169719edda27.tar.bz2
ibus-hangul: Use Ctrl+Alt+F9 as a Hanja hot-key instead of F9.
Since F9 is reserved by the window manager on Chrome OS. BUG=chromium-os:4319 TEST=manually Review URL: http://codereview.chromium.org/2800039 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51654 0039d316-1c4b-4281-b951-d872f2087c98
-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
-rw-r--r--chrome/common/pref_names.cc2
-rw-r--r--chrome/common/pref_names.h1
5 files changed, 17 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_;
diff --git a/chrome/common/pref_names.cc b/chrome/common/pref_names.cc
index b8e7d07..631e38c 100644
--- a/chrome/common/pref_names.cc
+++ b/chrome/common/pref_names.cc
@@ -248,6 +248,8 @@ const wchar_t kLanguageChewingHsuSelKeyType[] =
// A string pref which determines the keyboard layout for Hangul input method.
const wchar_t kLanguageHangulKeyboard[] = L"settings.language.hangul_keyboard";
+const wchar_t kLanguageHangulHanjaKeys[] =
+ L"settings.language.hangul_hanja_keys";
// A boolean prefs for ibus-pinyin Chinese input method.
const wchar_t kLanguagePinyinCorrectPinyin[] =
diff --git a/chrome/common/pref_names.h b/chrome/common/pref_names.h
index e5350dc..0ad00b8 100644
--- a/chrome/common/pref_names.h
+++ b/chrome/common/pref_names.h
@@ -91,6 +91,7 @@ extern const wchar_t kLanguageChewingKeyboardType[];
extern const wchar_t kLanguageChewingSelKeys[];
extern const wchar_t kLanguageChewingHsuSelKeyType[];
extern const wchar_t kLanguageHangulKeyboard[];
+extern const wchar_t kLanguageHangulHanjaKeys[];
extern const wchar_t kLanguagePinyinCorrectPinyin[];
extern const wchar_t kLanguagePinyinFuzzyPinyin[];
extern const wchar_t kLanguagePinyinLookupTablePageSize[];