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

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: update Created 7 years 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
« no previous file with comments | « ui/base/ime/input_method_imm32.cc ('k') | ui/base/ime/win/mock_tsf_bridge.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
};
« no previous file with comments | « ui/base/ime/input_method_imm32.cc ('k') | ui/base/ime/win/mock_tsf_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698