| 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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 language_code == "de") { | 634 language_code == "de") { |
| 635 text = GetLanguageName(language_code) + L" - "; | 635 text = GetLanguageName(language_code) + L" - "; |
| 636 } | 636 } |
| 637 text += input_method::GetString(input_method.display_name, input_method.id); | 637 text += input_method::GetString(input_method.display_name, input_method.id); |
| 638 | 638 |
| 639 DCHECK(!text.empty()); | 639 DCHECK(!text.empty()); |
| 640 return text; | 640 return text; |
| 641 } | 641 } |
| 642 | 642 |
| 643 void InputMethodMenu::RegisterPrefs(PrefService* local_state) { | 643 void InputMethodMenu::RegisterPrefs(PrefService* local_state) { |
| 644 local_state->RegisterStringPref(language_prefs::kPreferredKeyboardLayout, ""); | 644 local_state->RegisterStringPref(language_prefs::kPreferredKeyboardLayout, |
| 645 "", |
| 646 false /* don't sync pref */); |
| 645 } | 647 } |
| 646 | 648 |
| 647 void InputMethodMenu::Observe(NotificationType type, | 649 void InputMethodMenu::Observe(NotificationType type, |
| 648 const NotificationSource& source, | 650 const NotificationSource& source, |
| 649 const NotificationDetails& details) { | 651 const NotificationDetails& details) { |
| 650 if (type == NotificationType::LOGIN_USER_CHANGED) { | 652 if (type == NotificationType::LOGIN_USER_CHANGED) { |
| 651 // When a user logs in, we should remove |this| object from the observer | 653 // When a user logs in, we should remove |this| object from the observer |
| 652 // list so that PreferenceUpdateNeeded() does not update the local state | 654 // list so that PreferenceUpdateNeeded() does not update the local state |
| 653 // anymore. | 655 // anymore. |
| 654 CrosLibrary::Get()->GetInputMethodLibrary()->RemoveObserver(this); | 656 CrosLibrary::Get()->GetInputMethodLibrary()->RemoveObserver(this); |
| 655 } | 657 } |
| 656 } | 658 } |
| 657 | 659 |
| 658 void InputMethodMenu::SetMinimumWidth(int width) { | 660 void InputMethodMenu::SetMinimumWidth(int width) { |
| 659 // On the OOBE network selection screen, fixed width menu would be preferable. | 661 // On the OOBE network selection screen, fixed width menu would be preferable. |
| 660 minimum_input_method_menu_width_ = width; | 662 minimum_input_method_menu_width_ = width; |
| 661 } | 663 } |
| 662 | 664 |
| 663 } // namespace chromeos | 665 } // namespace chromeos |
| OLD | NEW |