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

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

Issue 2728433002: Unnecessarily cursor appears in omnibox after clicking inside the 'Search box' (Closed)
Patch Set: address comments Created 3 years, 10 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_test_api.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/textfield/textfield.cc
diff --git a/ui/views/controls/textfield/textfield.cc b/ui/views/controls/textfield/textfield.cc
index 01a666be628b77420bc5d76c902de3877e681d9f..342e5137acd96751d31e38a57289bd3b1e7aefce 100644
--- a/ui/views/controls/textfield/textfield.cc
+++ b/ui/views/controls/textfield/textfield.cc
@@ -1909,8 +1909,8 @@ void Textfield::UpdateAfterChange(bool text_changed, bool cursor_changed) {
NotifyAccessibilityEvent(ui::AX_EVENT_TEXT_CHANGED, true);
}
if (cursor_changed) {
- cursor_view_.SetVisible(ShouldShowCursor());
UpdateCursorView();
+ cursor_view_.SetVisible(ShouldShowCursor());
if (ShouldBlinkCursor())
StartBlinkingCursor();
else
@@ -2067,7 +2067,7 @@ void Textfield::OnEditFailed() {
bool Textfield::ShouldShowCursor() const {
return HasFocus() && !HasSelection() && enabled() && !read_only() &&
- !drop_cursor_visible_;
+ !drop_cursor_visible_ && GetRenderText()->cursor_enabled();
}
bool Textfield::ShouldBlinkCursor() const {
« no previous file with comments | « no previous file | ui/views/controls/textfield/textfield_test_api.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698