| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/chromeos/status/input_method_menu.h" | 5 #include "chrome/browser/chromeos/status/input_method_menu.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 636 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 647 // usually imply (or explicitly include) its language. | 647 // usually imply (or explicitly include) its language. |
| 648 | 648 |
| 649 // Special case for Dutch, French and German: these languages have multiple | 649 // Special case for Dutch, French and German: these languages have multiple |
| 650 // keyboard layouts and share the same laout of keyboard (Belgian). We need to | 650 // keyboard layouts and share the same laout of keyboard (Belgian). We need to |
| 651 // show explicitly the language for the layout. | 651 // show explicitly the language for the layout. |
| 652 // For Arabic, Amharic, and Indic languages: they share "Standard Input | 652 // For Arabic, Amharic, and Indic languages: they share "Standard Input |
| 653 // Method". | 653 // Method". |
| 654 const std::string language_code | 654 const std::string language_code |
| 655 = input_method::GetLanguageCodeFromDescriptor(input_method); | 655 = input_method::GetLanguageCodeFromDescriptor(input_method); |
| 656 std::wstring text; | 656 std::wstring text; |
| 657 // TODO(yusukes): Add Telugu and Kanada. | |
| 658 if (language_code == "am" || | 657 if (language_code == "am" || |
| 659 language_code == "ar" || | 658 language_code == "ar" || |
| 660 language_code == "bn" || | 659 language_code == "bn" || |
| 661 language_code == "de" || | 660 language_code == "de" || |
| 662 language_code == "fr" || | 661 language_code == "fr" || |
| 663 language_code == "gu" || | 662 language_code == "gu" || |
| 664 language_code == "hi" || | 663 language_code == "hi" || |
| 664 language_code == "kn" || |
| 665 language_code == "ml" || | 665 language_code == "ml" || |
| 666 language_code == "mr" || | 666 language_code == "mr" || |
| 667 language_code == "nl" || | 667 language_code == "nl" || |
| 668 language_code == "ta") { | 668 language_code == "ta" || |
| 669 language_code == "te") { |
| 669 text = GetLanguageName(language_code) + L" - "; | 670 text = GetLanguageName(language_code) + L" - "; |
| 670 } | 671 } |
| 671 text += input_method::GetString(input_method.id(), input_method.id()); | 672 text += input_method::GetString(input_method.id(), input_method.id()); |
| 672 | 673 |
| 673 DCHECK(!text.empty()); | 674 DCHECK(!text.empty()); |
| 674 return text; | 675 return text; |
| 675 } | 676 } |
| 676 | 677 |
| 677 void InputMethodMenu::RegisterPrefs(PrefService* local_state) { | 678 void InputMethodMenu::RegisterPrefs(PrefService* local_state) { |
| 678 // We use an empty string here rather than a hardware keyboard layout name | 679 // We use an empty string here rather than a hardware keyboard layout name |
| (...skipping 15 matching lines...) Expand all Loading... |
| 694 InputMethodManager::GetInstance()->RemoveObserver(this); | 695 InputMethodManager::GetInstance()->RemoveObserver(this); |
| 695 } | 696 } |
| 696 } | 697 } |
| 697 | 698 |
| 698 void InputMethodMenu::SetMinimumWidth(int width) { | 699 void InputMethodMenu::SetMinimumWidth(int width) { |
| 699 // On the OOBE network selection screen, fixed width menu would be preferable. | 700 // On the OOBE network selection screen, fixed width menu would be preferable. |
| 700 minimum_input_method_menu_width_ = width; | 701 minimum_input_method_menu_width_ = width; |
| 701 } | 702 } |
| 702 | 703 |
| 703 } // namespace chromeos | 704 } // namespace chromeos |
| OLD | NEW |