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