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

Unified Diff: components/omnibox/browser/omnibox_edit_model.cc

Issue 2891653003: [omnibox] Break out SetCaretPos() method and enhance browser test (Closed)
Patch Set: Better Mac call Created 3 years, 7 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
Index: components/omnibox/browser/omnibox_edit_model.cc
diff --git a/components/omnibox/browser/omnibox_edit_model.cc b/components/omnibox/browser/omnibox_edit_model.cc
index e9fd507c1c66e3999e1de6bffcfd1fd5b7fe8ed6..f43f8924e7d331edfdf90eeaa4a4038c3cce9099 100644
--- a/components/omnibox/browser/omnibox_edit_model.cc
+++ b/components/omnibox/browser/omnibox_edit_model.cc
@@ -372,9 +372,8 @@ void OmniboxEditModel::Revert() {
has_temporary_text_ = false;
size_t start, end;
view_->GetSelectionBounds(&start, &end);
- view_->SetWindowTextAndCaretPos(permanent_text_, 0, false, false);
- view_->SetWindowTextAndCaretPos(
- permanent_text_, std::min(permanent_text_.length(), start), false, true);
+ view_->SetWindowTextAndCaretPos(permanent_text_, 0, false, true);
Peter Kasting 2017/05/18 18:38:34 Nit: I didn't mention this before, but this deserv
Kevin Bailey 2017/05/18 19:48:17 Done.
+ view_->SetCaretPos(std::min(permanent_text_.length(), start));
Peter Kasting 2017/05/18 18:38:34 Should we use SetCaretPos() first, then SetWindowT
Kevin Bailey 2017/05/18 19:48:17 Ya, RenderText apparently won't update with just a
client_->OnRevert();
}

Powered by Google App Engine
This is Rietveld 408576698