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