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

Unified Diff: ui/gfx/render_text.h

Issue 14264004: Re-land: NativeTextfieldViews: Show the drop cursor when dragging text (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 4 Created 7 years, 8 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 | ui/gfx/render_text.cc » ('j') | ui/views/controls/textfield/native_textfield_views.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/render_text.h
diff --git a/ui/gfx/render_text.h b/ui/gfx/render_text.h
index 018f7d3088847090016b69e01ef25267ccdb6f80..a7ea9e698c3a4522b174346e917f78aa12c5ec42 100644
--- a/ui/gfx/render_text.h
+++ b/ui/gfx/render_text.h
@@ -275,6 +275,9 @@ class UI_EXPORT RenderText {
void Draw(Canvas* canvas);
+ // Draws a cursor at |position|.
+ void DrawCursor(Canvas* canvas, const SelectionModel& position);
+
// Draw the selected text without a cursor or selection highlight.
void DrawSelectedText(Canvas* canvas);
@@ -316,6 +319,12 @@ class UI_EXPORT RenderText {
// chosen.
virtual std::vector<FontSpan> GetFontSpansForTesting() = 0;
+ // A convenience function to check whether the glyph attached to the caret
+ // is within the given range.
+ static bool RangeContainsCaret(const ui::Range& range,
+ size_t caret_pos,
+ LogicalCursorDirection caret_affinity);
+
protected:
RenderText();
@@ -419,12 +428,6 @@ class UI_EXPORT RenderText {
// Applies text shadows to |renderer|.
void ApplyTextShadows(internal::SkiaTextRenderer* renderer);
- // A convenience function to check whether the glyph attached to the caret
- // is within the given range.
- static bool RangeContainsCaret(const ui::Range& range,
- size_t caret_pos,
- LogicalCursorDirection caret_affinity);
-
private:
friend class RenderTextTest;
FRIEND_TEST_ALL_PREFIXES(RenderTextTest, DefaultStyle);
@@ -449,9 +452,8 @@ class UI_EXPORT RenderText {
// cursor is within the visible display area.
void UpdateCachedBoundsAndOffset();
- // Draw the selection and cursor.
+ // Draw the selection.
void DrawSelection(Canvas* canvas);
- void DrawCursor(Canvas* canvas);
// Logical UTF-16 string data to be drawn.
string16 text_;
« no previous file with comments | « no previous file | ui/gfx/render_text.cc » ('j') | ui/views/controls/textfield/native_textfield_views.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698