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

Unified Diff: chrome/browser/chromeos/input_method/input_method_engine_ibus.cc

Issue 11447007: Fix unexpected auxiliary text appearance. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 7 years, 11 months 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 | « chrome/browser/chromeos/input_method/input_method_engine_ibus.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
index cdced7ac5217c80bb273f7968e09966e58c83096..7803d0c77e338225b40bd01d820497f72ca417a8 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
@@ -52,7 +52,7 @@ InputMethodEngineIBus::InputMethodEngineIBus()
preedit_cursor_(0),
component_(new ibus::IBusComponent()),
table_(new ibus::IBusLookupTable()),
- table_visible_(false),
+ window_visible_(false),
weak_ptr_factory_(this) {
}
@@ -209,46 +209,49 @@ bool InputMethodEngineIBus::SetCandidateWindowVisible(bool visible,
return false;
}
- table_visible_ = visible;
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ window_visible_ = visible;
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
return true;
}
void InputMethodEngineIBus::SetCandidateWindowCursorVisible(bool visible) {
- if (!active_)
- return;
table_->set_is_cursor_visible(visible);
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ if (active_)
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
}
void InputMethodEngineIBus::SetCandidateWindowVertical(bool vertical) {
- if (!active_)
- return;
table_->set_orientation(
vertical ? ibus::IBusLookupTable::IBUS_LOOKUP_TABLE_ORIENTATION_VERTICAL :
ibus::IBusLookupTable::IBUS_LOOKUP_TABLE_ORIENTATION_HORIZONTAL);
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ if (active_)
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
}
void InputMethodEngineIBus::SetCandidateWindowPageSize(int size) {
- if (!active_)
- return;
table_->set_page_size(size);
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ if (active_)
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
}
void InputMethodEngineIBus::SetCandidateWindowAuxText(const char* text) {
- if (!active_)
- return;
aux_text_->set_text(text);
- GetCurrentService()->UpdateAuxiliaryText(*aux_text_.get(), aux_text_visible_);
+ if (active_) {
+ // Should not show auxiliary text if the whole window visibility is false.
+ GetCurrentService()->UpdateAuxiliaryText(
+ *aux_text_.get(),
+ window_visible_ && aux_text_visible_);
+ }
}
void InputMethodEngineIBus::SetCandidateWindowAuxTextVisible(bool visible) {
- if (!active_)
- return;
aux_text_visible_ = visible;
- GetCurrentService()->UpdateAuxiliaryText(*aux_text_.get(), aux_text_visible_);
+ if (active_) {
+ // Should not show auxiliary text if the whole window visibility is false.
+ GetCurrentService()->UpdateAuxiliaryText(
+ *aux_text_.get(),
+ window_visible_ && aux_text_visible_);
+ }
}
bool InputMethodEngineIBus::SetCandidates(
@@ -283,7 +286,7 @@ bool InputMethodEngineIBus::SetCandidates(
table_->mutable_candidates()->push_back(entry);
}
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
return true;
}
@@ -306,7 +309,7 @@ bool InputMethodEngineIBus::SetCursorPosition(int context_id, int candidate_id,
}
table_->set_cursor_position(position->second);
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
return true;
}
« no previous file with comments | « chrome/browser/chromeos/input_method/input_method_engine_ibus.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698