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

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

Issue 6982055: Draw a NativeTextfieldViews drop location cursor. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Combine cursor bounds data members, revise UpdateCursorBoundsAndTextOffset. Created 9 years, 6 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 | « no previous file | views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/textfield/native_textfield_views.h
diff --git a/views/controls/textfield/native_textfield_views.h b/views/controls/textfield/native_textfield_views.h
index 7f221d555041337d1ddd1a919613fae127b88900..d7edfd583fe737686cdb82157170fd834af5b562 100644
--- a/views/controls/textfield/native_textfield_views.h
+++ b/views/controls/textfield/native_textfield_views.h
@@ -182,8 +182,11 @@ class NativeTextfieldViews : public View,
// Repaint the cursor.
void RepaintCursor();
+ // Returns the bounds of character at the current cursor.
+ gfx::Rect GetCursorBounds(size_t cursor_pos, bool insert_mode) const;
+
// Update the cursor_bounds and text_offset.
- void UpdateCursorBoundsAndTextOffset();
+ void UpdateCursorBoundsAndTextOffset(size_t cursor_pos, bool insert_mode);
void PaintTextAndCursor(gfx::Canvas* canvas);
@@ -242,15 +245,16 @@ class NativeTextfieldViews : public View,
// The x offset for the text to be drawn, without insets;
int text_offset_;
- // Cursor's bounds in the textfield's coordinates.
- gfx::Rect cursor_bounds_;
-
// True if the textfield is in insert mode.
bool insert_;
- // The drawing state of cursor. True to draw.
+ // The local bounds and visibility of the textfield's text cursor.
+ gfx::Rect cursor_bounds_;
bool is_cursor_visible_;
+ // The drop cursor is a visual cue for where dragged text will be dropped.
+ bool is_drop_cursor_visible_;
+
// True if InputMethod::CancelComposition() should not be called.
bool skip_input_method_cancel_composition_;
« no previous file with comments | « no previous file | views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698