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

Unified Diff: views/controls/textfield/textfield.cc

Issue 6675005: Integrate the new input method API for Views into Chromium. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 9 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
Index: views/controls/textfield/textfield.cc
diff --git a/views/controls/textfield/textfield.cc b/views/controls/textfield/textfield.cc
index 7dfa4daf743ff696df24a3dcf65e9e95b2e41e5f..1d6b078d29ae8e85a7ba9f82f741de42b9676407 100644
--- a/views/controls/textfield/textfield.cc
+++ b/views/controls/textfield/textfield.cc
@@ -244,8 +244,14 @@ void Textfield::UpdateAllProperties() {
}
void Textfield::SyncText() {
- if (native_wrapper_)
- text_ = native_wrapper_->GetText();
+ if (native_wrapper_) {
+ string16 new_text = native_wrapper_->GetText();
+ if (new_text != text_) {
+ text_ = new_text;
+ if (controller_)
+ controller_->ContentsChanged(this, text_);
+ }
+ }
}
bool Textfield::IsIMEComposing() const {
@@ -367,6 +373,10 @@ void Textfield::GetAccessibleState(ui::AccessibleViewState* state) {
state->selection_end = range.end();
}
+TextInputClient* Textfield::GetTextInputClient() {
+ return native_wrapper_ ? native_wrapper_->GetTextInputClient() : NULL;
+}
+
void Textfield::SetEnabled(bool enabled) {
View::SetEnabled(enabled);
if (native_wrapper_)

Powered by Google App Engine
This is Rietveld 408576698