Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(63)

Unified Diff: ui/base/ime/input_method_tsf.cc

Issue 80583002: [FYI] All-in-one OnCandidateWindow{Show,Update,Hide} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};

Powered by Google App Engine
This is Rietveld 408576698