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

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: Created 8 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
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 8d22e8cabd5dce32b249eea2346925779f680d7a..883f13079d32770d317ed385ab1d7e0ac2a9e1ef 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine_ibus.cc
@@ -51,7 +51,7 @@ InputMethodEngineIBus::InputMethodEngineIBus()
preedit_cursor_(0),
component_(new ibus::IBusComponent()),
table_(new ibus::IBusLookupTable()),
- table_visible_(false),
+ window_visible_(false),
weak_ptr_factory_(this) {
}
@@ -211,46 +211,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(
@@ -285,7 +288,7 @@ bool InputMethodEngineIBus::SetCandidates(
table_->mutable_candidates()->push_back(entry);
}
- GetCurrentService()->UpdateLookupTable(*table_.get(), table_visible_);
+ GetCurrentService()->UpdateLookupTable(*table_.get(), window_visible_);
return true;
}
@@ -308,7 +311,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;
}

Powered by Google App Engine
This is Rietveld 408576698