Chromium Code Reviews| Index: chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| diff --git a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| index 202ca5b41ad063146e27fd46bfa3535c585138c1..06cba5a35cc06369515c8e903a8ff07d75a6a69d 100644 |
| --- a/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| +++ b/chrome/browser/ui/ash/system_tray_delegate_chromeos.cc |
| @@ -11,6 +11,8 @@ |
| #include "ash/ash_switches.h" |
| #include "ash/desktop_background/desktop_background_controller.h" |
| +#include "ash/ime/input_method_menu_item.h" |
| +#include "ash/ime/input_method_menu_manager.h" |
| #include "ash/metrics/user_metrics_recorder.h" |
| #include "ash/session_state_delegate.h" |
| #include "ash/session_state_observer.h" |
| @@ -298,6 +300,7 @@ void SystemTrayDelegateChromeOS::Initialize() { |
| DBusThreadManager::Get()->GetSessionManagerClient()->AddObserver(this); |
| input_method::InputMethodManager::Get()->AddObserver(this); |
| + ash::ime::InputMethodMenuManager::Get()->AddObserver(this); |
|
Daniel Erat
2014/02/12 15:17:35
i think you're missing a RemoveObserver() call in
Junichi Uekawa
2014/02/12 22:19:53
Done.
|
| UpdateClockType(); |
| if (SystemKeyEventListener::GetInstance()) |
| @@ -762,15 +765,14 @@ void SystemTrayDelegateChromeOS::GetAvailableIMEList(ash::IMEInfoList* list) { |
| void SystemTrayDelegateChromeOS::GetCurrentIMEProperties( |
| ash::IMEPropertyInfoList* list) { |
| - input_method::InputMethodManager* manager = |
| - input_method::InputMethodManager::Get(); |
| - input_method::InputMethodPropertyList properties = |
| - manager->GetCurrentInputMethodProperties(); |
| - for (size_t i = 0; i < properties.size(); ++i) { |
| + ash::ime::InputMethodMenuItemList menu_list = |
| + ash::ime::InputMethodMenuManager::Get()-> |
| + GetCurrentInputMethodMenuItemList(); |
| + for (size_t i = 0; i < menu_list.size(); ++i) { |
| ash::IMEPropertyInfo property; |
| - property.key = properties[i].key; |
| - property.name = base::UTF8ToUTF16(properties[i].label); |
| - property.selected = properties[i].is_selection_item_checked; |
| + property.key = menu_list[i].key; |
| + property.name = base::UTF8ToUTF16(menu_list[i].label); |
| + property.selected = menu_list[i].is_selection_item_checked; |
| list->push_back(property); |
| } |
| } |
| @@ -780,7 +782,7 @@ void SystemTrayDelegateChromeOS::SwitchIME(const std::string& ime_id) { |
| } |
| void SystemTrayDelegateChromeOS::ActivateIMEProperty(const std::string& key) { |
| - input_method::InputMethodManager::Get()->ActivateInputMethodProperty(key); |
| + input_method::InputMethodManager::Get()->ActivateInputMethodMenuItem(key); |
| } |
| void SystemTrayDelegateChromeOS::CancelDriveOperation(int32 operation_id) { |
| @@ -1197,8 +1199,9 @@ void SystemTrayDelegateChromeOS::InputMethodChanged( |
| GetSystemTrayNotifier()->NotifyRefreshIME(show_message); |
| } |
| -void SystemTrayDelegateChromeOS::InputMethodPropertyChanged( |
| - input_method::InputMethodManager* manager) { |
| +// Overridden from InputMethodMenuManager::Observer. |
| +void SystemTrayDelegateChromeOS::InputMethodMenuItemChanged( |
| + ash::ime::InputMethodMenuManager* manager) { |
| GetSystemTrayNotifier()->NotifyRefreshIME(false); |
| } |