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

Issue 2860503004: [omnibox] Home cursor, then restore, on revert (Closed)

Created:
3 years, 7 months ago by Kevin Bailey
Modified:
3 years, 7 months ago
Reviewers:
Peter Kasting, Mark P
CC:
chromium-reviews, jdonnelly+watch_chromium.org, Mark P
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

If text was appended to a URL, the omnibox was shifting it to show the new text. This change makes it such that the text is only shifted if the user is editing. Otherwise, it homes the cursor, showing the origin. BUG=681740 Review-Url: https://codereview.chromium.org/2860503004 Cr-Commit-Position: refs/heads/master@{#472440} Committed: https://chromium.googlesource.com/chromium/src/+/5a8c1da2cda8f195695bc226dacdd35964df4113

Patch Set 1 #

Patch Set 2 : Incorporated working version #

Patch Set 3 : Fix browser test #

Patch Set 4 : Preserve cursor and scroll to left, restore test #

Total comments: 9

Patch Set 5 : Always jog caret #

Patch Set 6 : Fix browsertest #

Patch Set 7 : Fix browsertest compilation #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+7 lines, -5 lines) Patch
M chrome/browser/ui/omnibox/omnibox_view_browsertest.cc View 1 2 3 4 5 6 1 chunk +2 lines, -2 lines 5 comments Download
M components/omnibox/browser/omnibox_edit_model.cc View 1 2 3 4 1 chunk +5 lines, -3 lines 0 comments Download

Messages

Total messages: 27 (10 generated)
Kevin Bailey
Hi Peter, I'm curious what you think of this, as a response to the issue. ...
3 years, 7 months ago (2017-05-15 17:02:23 UTC) #3
Peter Kasting
To make sure I have this clear, the issue is what happens when the underlying ...
3 years, 7 months ago (2017-05-15 19:07:10 UTC) #4
Kevin Bailey
On 2017/05/15 19:07:10, Peter Kasting wrote: > To make sure I have this clear, the ...
3 years, 7 months ago (2017-05-15 20:36:35 UTC) #5
Peter Kasting
On 2017/05/15 20:36:35, Kevin Bailey wrote: > Preserving the cursor but scrolling to the left ...
3 years, 7 months ago (2017-05-15 21:05:48 UTC) #6
Kevin Bailey
On 2017/05/15 21:05:48, Peter Kasting wrote: > On 2017/05/15 20:36:35, Kevin Bailey wrote: > > ...
3 years, 7 months ago (2017-05-15 23:33:30 UTC) #7
Peter Kasting
On 2017/05/15 23:33:30, Kevin Bailey wrote: > It doesn't look to me as though we ...
3 years, 7 months ago (2017-05-15 23:51:23 UTC) #8
Kevin Bailey
ack, to the plumbing requirements https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc File components/omnibox/browser/omnibox_edit_model.cc (right): https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc#newcode374 components/omnibox/browser/omnibox_edit_model.cc:374: if (has_focus() && user_input_was_in_progress) ...
3 years, 7 months ago (2017-05-16 01:01:01 UTC) #9
Peter Kasting
https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc File components/omnibox/browser/omnibox_edit_model.cc (right): https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc#newcode374 components/omnibox/browser/omnibox_edit_model.cc:374: if (has_focus() && user_input_was_in_progress) { On 2017/05/16 01:01:01, Kevin ...
3 years, 7 months ago (2017-05-16 05:53:54 UTC) #10
Kevin Bailey
Ok, bots are finally happy with the latest browser test. (Preserving the cursor required a ...
3 years, 7 months ago (2017-05-17 01:53:54 UTC) #11
Peter Kasting
LGTM with hope for more testing https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc File components/omnibox/browser/omnibox_edit_model.cc (right): https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc#newcode381 components/omnibox/browser/omnibox_edit_model.cc:381: view_->SetWindowTextAndCaretPos(permanent_text_, start, false, ...
3 years, 7 months ago (2017-05-17 02:44:14 UTC) #12
Kevin Bailey
https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc File components/omnibox/browser/omnibox_edit_model.cc (right): https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc#newcode381 components/omnibox/browser/omnibox_edit_model.cc:381: view_->SetWindowTextAndCaretPos(permanent_text_, start, false, true); On 2017/05/17 02:44:14, Peter Kasting ...
3 years, 7 months ago (2017-05-17 03:57:52 UTC) #13
Peter Kasting
https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc File components/omnibox/browser/omnibox_edit_model.cc (right): https://codereview.chromium.org/2860503004/diff/60001/components/omnibox/browser/omnibox_edit_model.cc#newcode381 components/omnibox/browser/omnibox_edit_model.cc:381: view_->SetWindowTextAndCaretPos(permanent_text_, start, false, true); On 2017/05/17 03:57:52, Kevin Bailey ...
3 years, 7 months ago (2017-05-17 03:59:21 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at: https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2860503004/120001
3 years, 7 months ago (2017-05-17 13:29:15 UTC) #20
commit-bot: I haz the power
Committed patchset #7 (id:120001) as https://chromium.googlesource.com/chromium/src/+/5a8c1da2cda8f195695bc226dacdd35964df4113
3 years, 7 months ago (2017-05-17 13:34:19 UTC) #23
Mark P
https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc File chrome/browser/ui/omnibox/omnibox_view_browsertest.cc (right): https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc#newcode870 chrome/browser/ui/omnibox/omnibox_view_browsertest.cc:870: EXPECT_EQ(0U, end); On 2017/05/17 03:57:52, Kevin Bailey wrote: > ...
3 years, 7 months ago (2017-05-22 23:58:48 UTC) #25
Kevin Bailey
https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc File chrome/browser/ui/omnibox/omnibox_view_browsertest.cc (right): https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omnibox/omnibox_view_browsertest.cc#newcode870 chrome/browser/ui/omnibox/omnibox_view_browsertest.cc:870: EXPECT_EQ(0U, end); On 2017/05/22 23:58:48, Mark P wrote: > ...
3 years, 7 months ago (2017-05-23 00:03:02 UTC) #26
Mark P
3 years, 7 months ago (2017-05-23 03:59:59 UTC) #27
Message was sent while issue was closed.
https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omni...
File chrome/browser/ui/omnibox/omnibox_view_browsertest.cc (right):

https://codereview.chromium.org/2860503004/diff/120001/chrome/browser/ui/omni...
chrome/browser/ui/omnibox/omnibox_view_browsertest.cc:870: EXPECT_EQ(0U, end);
On 2017/05/23 00:03:02, Kevin Bailey wrote:
> On 2017/05/22 23:58:48, Mark P wrote:
> > On 2017/05/17 03:57:52, Kevin Bailey wrote:
> > > On 2017/05/17 02:44:14, Peter Kasting wrote:
> > > > Maybe before RevertAll() we should explicitly move the cursor (e.g. to
> > > position
> > > > 1) and check that that cursor position is preserved.  If not that, then
> > there
> > > > should be some other similar test in this CL, which clearly tests that
the
> > > > result of reverting is neither setting the cursor to start or end but
> > > preserving
> > > > it.
> > > > 
> > > > Perhaps there should also be something that verifies that when the new
> text
> > is
> > > > shorter, the length gets clamped.
> > > 
> > > ack, good suggestions.
> > 
> > I don't see a change after this comment.  Did you decide not to do it?
> 
> https://codereview.chromium.org/2891653003/

Awesome.  I love follow-through. :-)

Powered by Google App Engine
This is Rietveld 408576698