Chromium Code Reviews| Index: chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| diff --git a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| index 4944bdc67716ff8f87506bb711707037868c8cfb..93a97271a18e062d3ded8f84fa88f9a4f2020f60 100644 |
| --- a/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| +++ b/chrome/browser/chromeos/input_method/input_method_manager_impl.cc |
| @@ -855,8 +855,7 @@ InputMethodManagerImpl::InputMethodManagerImpl( |
| state_(NULL), |
| util_(delegate_.get()), |
| component_extension_ime_manager_(new ComponentExtensionIMEManager()), |
| - enable_extension_loading_(enable_extension_loading), |
| - is_ime_menu_activated_(false) { |
| + enable_extension_loading_(enable_extension_loading) { |
| // TODO(mohsen): Revisit using FakeImeKeyboard with mash when InputController |
| // work is ready. http://crbug.com/601981 |
| if (base::SysInfo::IsRunningOnChromeOS() && !chrome::IsRunningInMash()) |
| @@ -927,15 +926,6 @@ void InputMethodManagerImpl::SetUISessionState(UISessionState new_ui_session) { |
| ui_session_ = new_ui_session; |
| if (ui_session_ == STATE_TERMINATING && candidate_window_controller_.get()) |
| candidate_window_controller_.reset(); |
| - |
| - // The expanded IME menu is only supportive with 'normal' screen type. It |
| - // should be deactivated when the screen type is not 'normal', and be |
| - // re-activated when changing back. |
| - if (is_ime_menu_activated_ && ui_session_ != STATE_TERMINATING) { |
| - FOR_EACH_OBSERVER( |
| - InputMethodManager::ImeMenuObserver, ime_menu_observers_, |
| - ImeMenuActivationChanged(ui_session_ == STATE_BROWSER_SCREEN)); |
| - } |
| } |
| void InputMethodManagerImpl::OnUserAddingStarted() { |
| @@ -1186,11 +1176,10 @@ void InputMethodManagerImpl::CandidateWindowClosed() { |
| void InputMethodManagerImpl::ImeMenuActivationChanged(bool is_active) { |
| // Saves the state that whether the expanded IME menu has been activated by |
| // users. This method is only called when the preference is changing. |
| - is_ime_menu_activated_ = is_active; |
| + menu_map_[state_->profile] = is_active; |
| FOR_EACH_OBSERVER(InputMethodManager::ImeMenuObserver, ime_menu_observers_, |
| ImeMenuActivationChanged(is_active)); |
| - UMA_HISTOGRAM_BOOLEAN("InputMethod.ImeMenu.ActivationChanged", |
| - is_ime_menu_activated_); |
| + UMA_HISTOGRAM_BOOLEAN("InputMethod.ImeMenu.ActivationChanged", is_active); |
| } |
| void InputMethodManagerImpl::NotifyImeMenuListChanged() { |
| @@ -1214,5 +1203,9 @@ void InputMethodManagerImpl::NotifyImeMenuItemsChanged( |
| ImeMenuItemsChanged(engine_id, items)); |
| } |
| +bool InputMethodManagerImpl::GetImeMenuActivation(Profile* profile) { |
| + return menu_map_.find(profile) != menu_map_.end() && menu_map_[profile]; |
|
stevenjb
2016/08/26 17:15:02
Instead of doing two lookups, use an iterator, e.g
Azure Wei
2016/08/26 21:59:59
Done.
|
| +} |
| + |
| } // namespace input_method |
| } // namespace chromeos |