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..6b0c22497be10fb66b4aec149f2a6c56b696b3de 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_activated_for_profile_[state_->profile] = is_active; |
|
Shu Chen
2016/08/27 03:11:01
Notifying ImeMenuActivationChanged() is a non-triv
Azure Wei
2016/08/27 06:55:30
The state is save by profile. We can't tell if it
Azure Wei
2016/08/27 07:08:49
Oh, we could save the previous state. Sorry.
Done.
|
| 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,10 @@ void InputMethodManagerImpl::NotifyImeMenuItemsChanged( |
| ImeMenuItemsChanged(engine_id, items)); |
| } |
| +bool InputMethodManagerImpl::GetImeMenuActivation(Profile* profile) { |
| + auto iter = menu_activated_for_profile_.find(profile); |
| + return iter != menu_activated_for_profile_.end() && iter->second; |
| +} |
| + |
| } // namespace input_method |
| } // namespace chromeos |