1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163
|
// Copyright 2024 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_ASH_INPUT_METHOD_JAPANESE_JAPANESE_PREFS_CONSTANTS_H_
#define CHROME_BROWSER_ASH_INPUT_METHOD_JAPANESE_JAPANESE_PREFS_CONSTANTS_H_
namespace ash::input_method {
// TODO(crbug.com/203464079): Use distinct CrOS prefs for nacl_mozc_jp
// ("Japanese [for JIS keyboard]") and nacl_mozc_us ("Japanese for US keyboard")
// input methods. Due to singleton constraints in the legacy implementation,
// unlike all other input methods whose settings were distinct from one another,
// these two input methods shared the same settings. Upon migration to CrOS
// prefs, the unintended sharing was intentionally retained until the issue is
// separately addressed outside the scope of the said migration. Thus, as of
// now, Japanese prefs should specially be set only once for ID "nacl_mozc_jp"
// and shared across both "nacl_mozc_jp" and "nacl_mozc_us" input methods.
inline constexpr std::string_view kJpPrefsEngineId = "nacl_mozc_jp";
// Top level option categories:
// LINT.IfChange(JpOptionCategories)
inline constexpr std::string_view kJpPrefAutomaticallySwitchToHalfwidth =
"AutomaticallySwitchToHalfwidth";
inline constexpr std::string_view kJpPrefShiftKeyModeStyle =
"ShiftKeyModeStyle";
inline constexpr std::string_view kJpPrefUseInputHistory = "UseInputHistory";
inline constexpr std::string_view kJpPrefUseSystemDictionary =
"UseSystemDictionary";
inline constexpr std::string_view kJpPrefNumberOfSuggestions =
"numberOfSuggestions";
inline constexpr std::string_view kJpPrefInputMode = "JapaneseInputMode";
inline constexpr std::string_view kJpPrefPunctuationStyle =
"JapanesePunctuationStyle";
inline constexpr std::string_view kJpPrefSymbolStyle = "JapaneseSymbolStyle";
inline constexpr std::string_view kJpPrefSpaceInputStyle =
"JapaneseSpaceInputStyle";
inline constexpr std::string_view kJpPrefSelectionShortcut =
"JapaneseSectionShortcut";
inline constexpr std::string_view kJpPrefKeymapStyle = "JapaneseKeymapStyle";
inline constexpr std::string_view kJpPrefDisablePersonalizedSuggestions =
"JapaneseDisableSuggestions";
// This option does not do anything, as all usage data uses UMA and adheres to
// UMA settings.
inline constexpr std::string_view kJpPrefAutomaticallySendStatisticsToGoogle =
"AutomaticallySendStatisticsToGoogle";
// LINT.ThenChange(/chrome/browser/resources/ash/settings/os_languages_page/input_method_util.ts:JpOptionCategories)
// Options values for the above option categories:
// LINT.IfChange(JpOptionValues)
inline constexpr std::string_view kJpPrefInputModeKana = "Kana";
inline constexpr std::string_view kJpPrefInputModeRomaji = "Romaji";
inline constexpr std::string_view kJpPrefPunctuationStyleKutenTouten =
"KutenTouten";
inline constexpr std::string_view kJpPrefPunctuationStyleCommaPeriod =
"CommaPeriod";
inline constexpr std::string_view kJpPrefPunctuationStyleKutenPeriod =
"KutenPeriod";
inline constexpr std::string_view kJpPrefPunctuationStyleCommaTouten =
"CommaTouten";
inline constexpr std::string_view kJpPrefSymbolStyleCornerBracketMiddleDot =
"CornerBracketMiddleDot";
inline constexpr std::string_view kJpPrefSymbolStyleSquareBracketSlash =
"SquareBracketSlash";
inline constexpr std::string_view kJpPrefSymbolStyleCornerBracketSlash =
"CornerBracketSlash";
inline constexpr std::string_view kJpPrefSymbolStyleSquareBracketMiddleDot =
"SquareBracketMiddleDot";
inline constexpr std::string_view kJpPrefSpaceInputStyleInputMode = "InputMode";
inline constexpr std::string_view kJpPrefSpaceInputStyleFullwidth = "Fullwidth";
inline constexpr std::string_view kJpPrefSpaceInputStyleHalfwidth = "Halfwidth";
inline constexpr std::string_view kJpPrefSelectionShortcutNoShortcut =
"NoShortcut";
inline constexpr std::string_view kJpPrefSelectionShortcutDigits123456789 =
"Digits123456789";
inline constexpr std::string_view kJpPrefSelectionShortcutAsdfghjkl =
"ASDFGHJKL";
inline constexpr std::string_view kJpPrefKeymapStyleCustom = "Custom";
inline constexpr std::string_view kJpPrefKeymapStyleAtok = "Atok";
inline constexpr std::string_view kJpPrefKeymapStyleMsIme = "MsIme";
inline constexpr std::string_view kJpPrefKeymapStyleKotoeri = "Kotoeri";
inline constexpr std::string_view kJpPrefKeymapStyleMobile = "Mobile";
inline constexpr std::string_view kJpPrefKeymapStyleChromeOs = "ChromeOs";
inline constexpr std::string_view kJpPrefShiftKeyModeStyleOff = "Off";
inline constexpr std::string_view kJpPrefShiftKeyModeStyleAlphanumeric =
"Alphanumeric";
inline constexpr std::string_view kJpPrefShiftKeyModeStyleKatakana = "Katakana";
// LINT.ThenChange(/chrome/browser/resources/ash/settings/os_languages_page/input_method_types.ts:JpOptionValues)
// Pref key and values related to the "source of truth" for the options data.
// These are not accessible via the OsSettings app and is only used as a way
// to detect when configuration data needs to be copied over from one source to
// another.
inline constexpr std::string_view kJpPrefMetadataOptionsSource =
"Metadata-OptionsSource";
// This is the special "legacy" configuration file that is used directly by the
// extension on disk to set configurations.
inline constexpr std::string_view kJpPrefMetadataOptionsSourceLegacyConfig1Db =
"LegacyConfig1Db";
// In SystemPK Japanese, the source of truth is the chromeos PrefService like
// the rest of the IMEs.
inline constexpr std::string_view kJpPrefMetadataOptionsSourcePrefService =
"PrefService";
// All the enums below correspond to UMA histograms enum values.
// LINT.IfChange(jp_settings_hist_enums)
enum class HistInputMode {
kRomaji = 0,
kKana = 1,
kMaxValue = kKana,
};
enum class HistKeymapStyle {
kCustom = 0,
kAtok = 1,
kMsime = 2,
kKotoeri = 3,
kMobile = 4,
kChromeos = 5,
kMaxValue = kChromeos,
};
enum class HistPunctuationStyle {
kKutenTouten = 0,
kCommaPeriod = 1,
kKutenPeriod = 2,
kCommaTouten = 3,
kMaxValue = kCommaTouten,
};
enum class HistSelectionShortcut {
kDigits123456789 = 0,
kAsdfghjkl = 1,
kNoShortcut = 2,
kMaxValue = kNoShortcut,
};
enum class HistShiftKeyModeStyle {
kOff = 0,
kAlphanumeric = 1,
kKatakana = 2,
kMaxValue = kKatakana,
};
enum class HistSpaceInputStyle {
kInputMode = 0,
kFullWidth = 1,
kHalfWidth = 2,
kMaxValue = kHalfWidth,
};
enum class HistSymbolStyle {
kCornerBracketMiddleDot = 0,
kSquareBracketSlash = 1,
kCornerBracketSlash = 2,
kSquareBracketMiddleDot = 3,
kMaxValue = kSquareBracketMiddleDot,
};
// LINT.ThenChange(/tools/metrics/histograms/metadata/input/enums.xml:jp_settings_hist_enums)
} // namespace ash::input_method
#endif // CHROME_BROWSER_ASH_INPUT_METHOD_JAPANESE_JAPANESE_PREFS_CONSTANTS_H_
|