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

Unified Diff: chrome/browser/chromeos/input_method/input_method_util.cc

Issue 606063002: Only strip 'keyboard' from the input method name for OOBE screen. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nits per comments. Created 6 years, 3 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/input_method_util.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_util.cc b/chrome/browser/chromeos/input_method/input_method_util.cc
index 69db27c379af9add29ca24f66092b06f90a51f17..0158e145811230640038ab9c4e1198d07e12a6ea 100644
--- a/chrome/browser/chromeos/input_method/input_method_util.cc
+++ b/chrome/browser/chromeos/input_method/input_method_util.cc
@@ -434,8 +434,8 @@ base::string16 InputMethodUtil::GetInputMethodMediumName(
return GetInputMethodShortName(input_method);
}
-base::string16 InputMethodUtil::GetInputMethodLongName(
- const InputMethodDescriptor& input_method) const {
+base::string16 InputMethodUtil::GetInputMethodLongNameInternal(
+ const InputMethodDescriptor& input_method, bool for_oobe) const {
if (!input_method.name().empty() && !IsKeyboardLayout(input_method.id())) {
// If the descriptor has a name, use it.
return base::UTF8ToUTF16(input_method.name());
@@ -443,25 +443,18 @@ base::string16 InputMethodUtil::GetInputMethodLongName(
// We don't show language here. Name of keyboard layout or input method
// usually imply (or explicitly include) its language.
-
// Special case for German, French and Dutch: these languages have multiple
// keyboard layouts and share the same layout of keyboard (Belgian). We need
- // to show explicitly the language for the layout. For Arabic, Amharic, and
- // Indic languages: they share "Standard Input Method".
- const base::string16 standard_input_method_text =
- delegate_->GetLocalizedString(
- IDS_OPTIONS_SETTINGS_LANGUAGES_M17N_STANDARD_INPUT_METHOD);
+ // to show explicitly the language for the layout.
DCHECK(!input_method.language_codes().empty());
const std::string language_code = input_method.language_codes().at(0);
- base::string16 text = TranslateString(input_method.id());
- if (text == standard_input_method_text ||
- language_code == "de" ||
- language_code == "fr" ||
- language_code == "nl") {
+ base::string16 text = (for_oobe || input_method.name().empty())
+ ? TranslateString(input_method.id())
+ : base::UTF8ToUTF16(input_method.name());
+ if (language_code == "de" || language_code == "fr" || language_code == "nl") {
const base::string16 language_name = delegate_->GetDisplayLanguageName(
language_code);
-
text = language_name + base::UTF8ToUTF16(" - ") + text;
}
@@ -469,6 +462,17 @@ base::string16 InputMethodUtil::GetInputMethodLongName(
return text;
}
+
+base::string16 InputMethodUtil::GetInputMethodLongNameStripped(
+ const InputMethodDescriptor& input_method) const {
+ return GetInputMethodLongNameInternal(input_method, true /* for_oobe */);
+}
+
+base::string16 InputMethodUtil::GetInputMethodLongName(
+ const InputMethodDescriptor& input_method) const {
+ return GetInputMethodLongNameInternal(input_method, false /* for_oobe */);
+}
+
const InputMethodDescriptor* InputMethodUtil::GetInputMethodDescriptorFromId(
const std::string& input_method_id) const {
InputMethodIdToDescriptorMap::const_iterator iter =

Powered by Google App Engine
This is Rietveld 408576698