Chromium Code Reviews| Index: ui/base/ime/input_method_tsf.cc |
| diff --git a/ui/base/ime/input_method_tsf.cc b/ui/base/ime/input_method_tsf.cc |
| index 845172dd09a710aaa763d44afae57910bee0f8b1..d58e3d7434534985c89247e4f215544b036f2084 100644 |
| --- a/ui/base/ime/input_method_tsf.cc |
| +++ b/ui/base/ime/input_method_tsf.cc |
| @@ -12,7 +12,7 @@ namespace ui { |
| class InputMethodTSF::TSFEventObserver : public TSFEventRouterObserver { |
| public: |
| - TSFEventObserver() : is_candidate_popup_open_(false) {} |
| + TSFEventObserver() : is_candidate_popup_open_(false), window_count_(0) {} |
| // Returns true if we know for sure that a candidate window (or IME suggest, |
| // etc.) is open. |
| @@ -21,11 +21,20 @@ class InputMethodTSF::TSFEventObserver : public TSFEventRouterObserver { |
| // Overridden from TSFEventRouterObserver: |
| virtual void OnCandidateWindowCountChanged(size_t window_count) OVERRIDE { |
| is_candidate_popup_open_ = (window_count != 0); |
| + if (window_count_ == 0 && window_count) { |
| + ui::TSFBridge::GetInstance()->OnCandidateWindowShow(); |
|
yukawa
2013/11/25 05:07:42
I'm not sure if we can safely call back external c
|
| + } else if (window_count_ && window_count) { |
| + ui::TSFBridge::GetInstance()->OnCandidateWindowUpdate(); |
| + } else if (window_count_ && window_count == 0) { |
| + ui::TSFBridge::GetInstance()->OnCandidateWindowHide(); |
| + } |
| + window_count_ = window_count; |
| } |
| private: |
| // True if we know for sure that a candidate window is open. |
| bool is_candidate_popup_open_; |
| + int window_count_; |
| DISALLOW_COPY_AND_ASSIGN(TSFEventObserver); |
| }; |