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

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

Issue 2322303002: Textfield: suppress cursor repaints when there's a selection (Closed)
Patch Set: refactor all the stuff Created 4 years, 3 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/views/controls/textfield/textfield.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.h
diff --git a/ui/views/controls/textfield/textfield.h b/ui/views/controls/textfield/textfield.h
index 22ff37b869acab431c7710407f0566326106d93e..2a3fe96478df8c8b56d33ff65c83a4fc6fa73e1b 100644
--- a/ui/views/controls/textfield/textfield.h
+++ b/ui/views/controls/textfield/textfield.h
@@ -392,6 +392,22 @@ class VIEWS_EXPORT Textfield : public View,
// Pastes the selection clipboard for the specified mouse event.
void PasteSelectionClipboard(const ui::MouseEvent& event);
+ // Returns true if an insertion cursor should be visible (a vertical bar,
+ // placed at the point new text will be inserted).
+ bool ShouldShowCursor() const;
+
+ // Returns true if an insertion cursor should be visible and blinking.
+ bool ShouldBlinkCursor() const;
+
+ // Starts and stops blinking the cursor, respectively. These are both
+ // idempotent if the cursor is already blinking/not blinking.
+ void StartBlinkingCursor();
+ void StopBlinkingCursor();
+
+ // Callback for the cursor blink timer. Called every
+ // |Textfield::GetCaretBlinkMs()|.
Peter Kasting 2016/09/20 17:15:41 Nit: No || on function names
Elly Fong-Jones 2016/09/21 14:00:10 Done.
+ void BlinkCursor();
Peter Kasting 2016/09/20 17:15:41 Nit: OnCursorBlinkTimerFired()?
Elly Fong-Jones 2016/09/21 14:00:10 Done.
+
// The text model.
std::unique_ptr<TextfieldModel> model_;
@@ -449,9 +465,8 @@ class VIEWS_EXPORT Textfield : public View,
// True if InputMethod::CancelComposition() should not be called.
bool skip_input_method_cancel_composition_;
- // The text editing cursor repaint timer and visibility.
- base::RepeatingTimer cursor_repaint_timer_;
- bool cursor_visible_;
+ // Insertion cursor repaint timer and visibility.
+ base::RepeatingTimer cursor_blink_timer_;
// The drop cursor is a visual cue for where dragged text will be dropped.
bool drop_cursor_visible_;
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698