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

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

Issue 6318004: Add TextRange and related methods to Textfield Views. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: " Created 9 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 | « views/controls/textfield/native_textfield_views.h ('k') | views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_views.cc
diff --git a/views/controls/textfield/native_textfield_views.cc b/views/controls/textfield/native_textfield_views.cc
index 60589d229090235068af5680084ec849796437ec..3cffeb80a402ba8a0bceb30d8449363ad39d88d2 100644
--- a/views/controls/textfield/native_textfield_views.cc
+++ b/views/controls/textfield/native_textfield_views.cc
@@ -274,12 +274,24 @@ bool NativeTextfieldViews::IsIMEComposing() const {
return false;
}
+void NativeTextfieldViews::GetSelectedRange(TextRange* range) const {
+ model_->GetSelectedRange(range);
+}
+
+void NativeTextfieldViews::SelectRange(const TextRange& range) {
+ model_->SelectRange(range);
+ SchedulePaint();
+}
+
+size_t NativeTextfieldViews::GetCursorPosition() const {
+ return model_->cursor_pos();
+}
+
bool NativeTextfieldViews::HandleKeyPressed(const views::KeyEvent& e) {
Textfield::Controller* controller = textfield_->GetController();
bool handled = false;
- if (controller) {
+ if (controller)
handled = controller->HandleKeyEvent(textfield_, e);
- }
return handled || HandleKeyEvent(e);
}
« no previous file with comments | « views/controls/textfield/native_textfield_views.h ('k') | views/controls/textfield/native_textfield_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698