| 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 5e6de052e55a0f9e38fbbd772e253e3b3aee0139..bf7708c4fc9238e2290bb8562554ade6abe9dd22 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,22 @@ 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) {
|
| + TSFBridge::GetInstance()->OnCandidateWindowShown();
|
| + } else if (window_count_ && window_count) {
|
| + TSFBridge::GetInstance()->OnCandidateWindowUpdated();
|
| + } else if (window_count_ && window_count == 0) {
|
| + TSFBridge::GetInstance()->OnCandidateWindowHidden();
|
| + }
|
| + window_count_ = window_count;
|
| }
|
|
|
| private:
|
| // True if we know for sure that a candidate window is open.
|
| bool is_candidate_popup_open_;
|
| + // Number of visible windows for showing candidates and their related
|
| + // information.
|
| + int window_count_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(TSFEventObserver);
|
| };
|
|
|