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

Side by Side Diff: chrome/browser/chromeos/language_preferences.h

Issue 1694017: Adding a configuration dialog for Pinyin input method. (Closed)
Patch Set: fixed all Created 10 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_CHROMEOS_LANGUAGE_PREFERENCES_H_ 5 #ifndef CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
6 #define CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_ 6 #define CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
7 7
8 #include "base/basictypes.h"
8 #include "chrome/common/pref_names.h" 9 #include "chrome/common/pref_names.h"
10 #include "grit/generated_resources.h"
9 11
10 // Section and config names for the IBus configuration daemon. 12 // Section and config names for the IBus configuration daemon.
11 namespace chromeos { 13 namespace chromeos {
12 14
13 // For ibus-daemon 15 // For ibus-daemon
14 const char kGeneralSectionName[] = "general"; 16 const char kGeneralSectionName[] = "general";
15 const char kHotKeySectionName[] = "general/hotkey"; 17 const char kHotKeySectionName[] = "general/hotkey";
16 const char kUseGlobalEngineConfigName[] = "use_global_engine"; 18 const char kUseGlobalEngineConfigName[] = "use_global_engine";
17 const char kPreloadEnginesConfigName[] = "preload_engines"; 19 const char kPreloadEnginesConfigName[] = "preload_engines";
18 const char kNextEngineConfigName[] = "next_engine"; 20 const char kNextEngineConfigName[] = "next_engine";
(...skipping 24 matching lines...) Expand all
43 45
44 // For Simplified Chinese input method (ibus-pinyin) 46 // For Simplified Chinese input method (ibus-pinyin)
45 const char kPinyinSectionName[] = "engine/Pinyin"; 47 const char kPinyinSectionName[] = "engine/Pinyin";
46 48
47 // We have to sync the |ibus_config_name|s with those in 49 // We have to sync the |ibus_config_name|s with those in
48 // ibus-pinyin/files/src/Config.cc. 50 // ibus-pinyin/files/src/Config.cc.
49 const struct { 51 const struct {
50 const wchar_t* pref_name; 52 const wchar_t* pref_name;
51 const char* ibus_config_name; 53 const char* ibus_config_name;
52 bool default_value; 54 bool default_value;
55 int message_id;
53 } kPinyinBooleanPrefs[] = { 56 } kPinyinBooleanPrefs[] = {
54 { prefs::kLanguagePinyinCorrectPinyin, "correct_pinyin", true }, 57 { prefs::kLanguagePinyinCorrectPinyin, "correct_pinyin", true,
55 { prefs::kLanguagePinyinFuzzyPinyin, "fuzzy_pinyin", false }, 58 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_CORRECT_PINYIN },
59 { prefs::kLanguagePinyinFuzzyPinyin, "fuzzy_pinyin", false,
60 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_FUZZY_PINYIN },
56 { prefs::kLanguagePinyinShiftSelectCandidate, "shift_select_candidate", 61 { prefs::kLanguagePinyinShiftSelectCandidate, "shift_select_candidate",
57 false }, 62 false, IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_SHIFT_SELECT_PINYIN },
58 { prefs::kLanguagePinyinMinusEqualPage, "minus_equal_page", true }, 63 { prefs::kLanguagePinyinMinusEqualPage, "minus_equal_page", true,
59 { prefs::kLanguagePinyinCommaPeriodPage, "comma_period_page", true }, 64 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_MINUS_EQUAL_PAGE },
60 { prefs::kLanguagePinyinAutoCommit, "auto_commit", false }, 65 { prefs::kLanguagePinyinCommaPeriodPage, "comma_period_page", true,
61 { prefs::kLanguagePinyinDoublePinyin, "double_pinyin", false }, 66 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_COMMA_PERIOD_PAGE },
62 { prefs::kLanguagePinyinInitChinese, "init_chinese", true }, 67 { prefs::kLanguagePinyinAutoCommit, "auto_commit", false,
63 { prefs::kLanguagePinyinInitFull, "init_full", false }, 68 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_AUTO_COMMIT },
64 { prefs::kLanguagePinyinInitFullPunct, "init_full_punct", true }, 69 { prefs::kLanguagePinyinDoublePinyin, "double_pinyin", false,
70 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_DOUBLE_PINYIN },
71 { prefs::kLanguagePinyinInitChinese, "init_chinese", true,
72 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_CHINESE },
73 { prefs::kLanguagePinyinInitFull, "init_full", false,
74 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_FULL },
75 { prefs::kLanguagePinyinInitFullPunct, "init_full_punct", true,
76 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_FULL_PUNCT },
65 { prefs::kLanguagePinyinInitSimplifiedChinese, "init_simplified_chinese", 77 { prefs::kLanguagePinyinInitSimplifiedChinese, "init_simplified_chinese",
66 true }, 78 true,
67 { prefs::kLanguagePinyinTradCandidate, "trad_candidate", false }, 79 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_INIT_SIMPLIFIED_CHINESE },
80 { prefs::kLanguagePinyinTradCandidate, "trad_candidate", false,
81 IDS_OPTIONS_SETTINGS_LANGUAGES_PINYIN_SETTING_TRAD_CANDIDATE },
68 // TODO(yusukes): Support PINYIN_{INCOMPLETE,CORRECT,FUZZY}_... prefs (32 82 // TODO(yusukes): Support PINYIN_{INCOMPLETE,CORRECT,FUZZY}_... prefs (32
69 // additional boolean prefs.) 83 // additional boolean prefs.)
70 }; 84 };
85 const size_t kNumPinyinBooleanPrefs = ARRAYSIZE_UNSAFE(kPinyinBooleanPrefs);
71 86
72 const struct { 87 const struct {
73 const wchar_t* pref_name; 88 const wchar_t* pref_name;
74 const char* ibus_config_name; 89 const char* ibus_config_name;
75 int default_value; 90 int default_value;
91 // TODO(yusukes): Add message_id if needed.
76 } kPinyinIntegerPrefs[] = { 92 } kPinyinIntegerPrefs[] = {
77 { prefs::kLanguagePinyinDoublePinyinSchema, "double_pinyin_schema", 0 }, 93 { prefs::kLanguagePinyinDoublePinyinSchema, "double_pinyin_schema", 0 },
78 // TODO(yusukes): the type of lookup_table_page_size on ibus should be uint. 94 // TODO(yusukes): the type of lookup_table_page_size on ibus should be uint.
79 { prefs::kLanguagePinyinLookupTablePageSize, "lookup_table_page_size", 5 }, 95 { prefs::kLanguagePinyinLookupTablePageSize, "lookup_table_page_size", 5 },
80 }; 96 };
97 const size_t kNumPinyinIntegerPrefs = ARRAYSIZE_UNSAFE(kPinyinIntegerPrefs);
81 98
82 // For Traditional Chinese input method (ibus-chewing) 99 // For Traditional Chinese input method (ibus-chewing)
83 100
84 // For Japanese input method (ibus-mozc) 101 // For Japanese input method (ibus-mozc)
85 102
86 // TODO(yusukes): Add constants for these components. 103 // TODO(yusukes): Add constants for these components.
87 } // chromeos 104 } // chromeos
88 105
89 #endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_ 106 #endif // CHROME_BROWSER_CHROMEOS_LANGUAGE_PREFERENCES_H_
90
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698