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

Issue 12039053: Fix cursor position for default provider searches in keyword mode. (Closed)

Created:
7 years, 11 months ago by Bart N.
Modified:
7 years, 10 months ago
Reviewers:
Mark P, Peter Kasting, sky
CC:
chromium-reviews, James Su
Visibility:
Public.

Description

Fix cursor position for default provider searches in keyword mode. In addition, simplify a few methods, add missing code to AutocompleteInput::Clear method and nuke AutocompleteInput::Equals method which is not used at all. BUG=171607 TEST=Manual testing with chrome://net-internals Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180826

Patch Set 1 #

Patch Set 2 : Added unit tests. #

Total comments: 5

Patch Set 3 : Addressed Mark's comments. #

Total comments: 23

Patch Set 4 : Addressed comments. #

Patch Set 5 : Nuked unused AI:Equals(). #

Total comments: 2

Patch Set 6 : Fixed a comment. #

Patch Set 7 : More verbose DCHECKs, fixed a bug and added a unit test to verify the fix. #

Patch Set 8 : Fixed a bug and added 4 more regression cases to the unit test. #

Total comments: 3

Patch Set 9 : Final set of fixes, including two unit test cases, previously not uploaded. #

Total comments: 2

Patch Set 10 : Added missing () to the comment in omnibox_edit_model.cc #

Unified diffs Side-by-side diffs Delta from patch set Stats (+137 lines, -55 lines) Patch
M chrome/browser/autocomplete/autocomplete_input.h View 1 2 3 4 1 chunk +2 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_input.cc View 1 2 3 4 5 6 2 chunks +8 lines, -14 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.h View 1 chunk +4 lines, -4 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider.cc View 1 2 3 4 5 6 7 8 2 chunks +36 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/keyword_provider_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +57 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.h View 2 chunks +3 lines, -3 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 2 3 4 9 chunks +21 lines, -16 lines 0 comments Download
M chrome/browser/ui/omnibox/omnibox_edit_model.cc View 1 2 3 4 5 6 7 8 9 1 chunk +6 lines, -0 lines 0 comments Download

Messages

Total messages: 47 (0 generated)
Bart N.
It's ready for review. I think Peter is OOO, so Mark if you have a ...
7 years, 11 months ago (2013-01-23 20:46:13 UTC) #1
Bart N.
On 2013/01/23 20:46:13, Bart N. wrote: > It's ready for review. > > I think ...
7 years, 11 months ago (2013-01-23 20:50:54 UTC) #2
Bart N.
On 2013/01/23 20:50:54, Bart N. wrote: > On 2013/01/23 20:46:13, Bart N. wrote: > > ...
7 years, 11 months ago (2013-01-23 22:01:31 UTC) #3
Mark P
https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/autocomplete_input.cc#newcode503 chrome/browser/autocomplete/autocomplete_input.cc:503: bool AutocompleteInput::Equals(const AutocompleteInput& other) const { Can you add ...
7 years, 11 months ago (2013-01-24 04:07:21 UTC) #4
Bart N.
PTAL https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/autocomplete_input.cc#newcode503 chrome/browser/autocomplete/autocomplete_input.cc:503: bool AutocompleteInput::Equals(const AutocompleteInput& other) const { On 2013/01/24 ...
7 years, 11 months ago (2013-01-24 18:32:04 UTC) #5
Mark P
https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/keyword_provider.cc File chrome/browser/autocomplete/keyword_provider.cc (right): https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/keyword_provider.cc#newcode153 chrome/browser/autocomplete/keyword_provider.cc:153: // keyword part from the input. On 2013/01/24 18:32:04, ...
7 years, 11 months ago (2013-01-24 19:32:15 UTC) #6
Bart N.
On 2013/01/24 19:32:15, Mark P wrote: > https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/keyword_provider.cc > File chrome/browser/autocomplete/keyword_provider.cc (right): > > https://codereview.chromium.org/12039053/diff/2002/chrome/browser/autocomplete/keyword_provider.cc#newcode153 ...
7 years, 11 months ago (2013-01-24 23:37:41 UTC) #7
Mark P
I think I'm a little confused still. I thought we were sending the cursor position ...
7 years, 11 months ago (2013-01-25 01:46:03 UTC) #8
Bart N.
On 2013/01/25 01:46:03, Mark P wrote: > I think I'm a little confused still. I ...
7 years, 11 months ago (2013-01-25 01:55:09 UTC) #9
Bart N.
On 2013/01/25 01:55:09, Bart N. wrote: > On 2013/01/25 01:46:03, Mark P wrote: > > ...
7 years, 11 months ago (2013-01-25 01:59:51 UTC) #10
Mark P
On Thu, Jan 24, 2013 at 5:59 PM, <bartn@chromium.org> wrote: > On 2013/01/25 01:55:09, Bart ...
7 years, 11 months ago (2013-01-25 02:23:33 UTC) #11
Bart N.
On 2013/01/25 02:23:33, Mark P wrote: > On Thu, Jan 24, 2013 at 5:59 PM, ...
7 years, 11 months ago (2013-01-25 03:23:19 UTC) #12
Mark P
On 2013/01/25 03:23:19, Bart N. wrote: > On 2013/01/25 02:23:33, Mark P wrote: > > ...
7 years, 11 months ago (2013-01-25 05:09:03 UTC) #13
Bart N.
> Also, if we keep the keyword separate, then every other provider will have to ...
7 years, 11 months ago (2013-01-25 17:19:06 UTC) #14
Mark P
Thanks for engaging in this discussion, which I'm afraid was longer than it ought to ...
7 years, 11 months ago (2013-01-25 21:19:14 UTC) #15
Peter Kasting
My brain is too fuzzy to figure out what this is doing, so I did ...
7 years, 11 months ago (2013-01-28 00:04:22 UTC) #16
Bart N.
Thanks for your feedback. PTAL. Mark - do you prefer to submit your KP cl ...
7 years, 10 months ago (2013-01-29 21:28:17 UTC) #17
Peter Kasting
https://codereview.chromium.org/12039053/diff/10002/chrome/browser/autocomplete/autocomplete_input.cc File chrome/browser/autocomplete/autocomplete_input.cc (right): https://codereview.chromium.org/12039053/diff/10002/chrome/browser/autocomplete/autocomplete_input.cc#newcode502 chrome/browser/autocomplete/autocomplete_input.cc:502: // url_parse::Parsed struct does not provide == operator. On ...
7 years, 10 months ago (2013-01-29 21:32:24 UTC) #18
Bart N.
On 2013/01/29 21:32:24, Peter Kasting wrote: > https://codereview.chromium.org/12039053/diff/10002/chrome/browser/autocomplete/autocomplete_input.cc > File chrome/browser/autocomplete/autocomplete_input.cc (right): > > https://codereview.chromium.org/12039053/diff/10002/chrome/browser/autocomplete/autocomplete_input.cc#newcode502 ...
7 years, 10 months ago (2013-01-29 21:53:55 UTC) #19
Mark P
> Mark - do you prefer to submit your KP cl before this one, or ...
7 years, 10 months ago (2013-01-29 22:17:10 UTC) #20
Mark P
lgtm Please play around with a debug build for a while to make sure none ...
7 years, 10 months ago (2013-01-29 22:25:37 UTC) #21
Bart N.
https://codereview.chromium.org/12039053/diff/17003/chrome/browser/autocomplete/keyword_provider.cc File chrome/browser/autocomplete/keyword_provider.cc (right): https://codereview.chromium.org/12039053/diff/17003/chrome/browser/autocomplete/keyword_provider.cc#newcode169 chrome/browser/autocomplete/keyword_provider.cc:169: // otherwise adjust it with relatively to the remaining ...
7 years, 10 months ago (2013-01-29 22:57:05 UTC) #22
Bart N.
On 2013/01/29 22:25:37, Mark P wrote: > lgtm > > > Please play around with ...
7 years, 10 months ago (2013-01-29 23:00:45 UTC) #23
Bart N.
On 2013/01/29 23:00:45, Bart N. wrote: > On 2013/01/29 22:25:37, Mark P wrote: > > ...
7 years, 10 months ago (2013-01-30 01:34:40 UTC) #24
Bart N.
On 2013/01/30 01:34:40, Bart N. wrote: > On 2013/01/29 23:00:45, Bart N. wrote: > > ...
7 years, 10 months ago (2013-01-30 19:15:04 UTC) #25
Mark P
https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc File chrome/browser/autocomplete/keyword_provider_unittest.cc (right): https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc#newcode260 chrome/browser/autocomplete/keyword_provider_unittest.cc:260: Can you test extra space after keyword but no ...
7 years, 10 months ago (2013-01-30 19:43:53 UTC) #26
Bart N.
I think I may need some help regarding one more failing condition. The test in ...
7 years, 10 months ago (2013-01-30 21:22:57 UTC) #27
Peter Kasting
On Wed, Jan 30, 2013 at 1:22 PM, <bartn@chromium.org> wrote: > Now, before I can ...
7 years, 10 months ago (2013-01-30 21:45:59 UTC) #28
Bart N.
> Generally when I see this I start spelunking through svn revision history > until ...
7 years, 10 months ago (2013-01-30 23:59:41 UTC) #29
Peter Kasting
On Wed, Jan 30, 2013 at 3:59 PM, <bartn@chromium.org> wrote: > Generally when I see ...
7 years, 10 months ago (2013-01-31 00:48:51 UTC) #30
Bart N.
On 2013/01/31 00:48:51, Peter Kasting wrote: > On Wed, Jan 30, 2013 at 3:59 PM, ...
7 years, 10 months ago (2013-01-31 01:16:08 UTC) #31
Mark P
https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc File chrome/browser/autocomplete/keyword_provider_unittest.cc (right): https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc#newcode260 chrome/browser/autocomplete/keyword_provider_unittest.cc:260: On 2013/01/30 21:22:58, Bart N. wrote: > On 2013/01/30 ...
7 years, 10 months ago (2013-01-31 19:46:11 UTC) #32
Bart N.
On 2013/01/31 19:46:11, Mark P wrote: > https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc > File chrome/browser/autocomplete/keyword_provider_unittest.cc (right): > > https://codereview.chromium.org/12039053/diff/25006/chrome/browser/autocomplete/keyword_provider_unittest.cc#newcode260 ...
7 years, 10 months ago (2013-01-31 19:55:27 UTC) #33
Bart N.
> Sorry about that. The comment got uploaded automatically when I replied earlier. > I'll ...
7 years, 10 months ago (2013-02-05 00:31:35 UTC) #34
Mark P
Still lgtm. On 2013/02/05 00:31:35, Bart N. wrote: > > Sorry about that. The comment ...
7 years, 10 months ago (2013-02-05 01:06:03 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartn@chromium.org/12039053/40001
7 years, 10 months ago (2013-02-05 02:08:16 UTC) #36
commit-bot: I haz the power
Presubmit check for 12039053-40001 failed and returned exit status 1. Running presubmit commit checks ...
7 years, 10 months ago (2013-02-05 02:08:23 UTC) #37
Bart N.
On 2013/02/05 02:08:23, I haz the power (commit-bot) wrote: > Presubmit check for 12039053-40001 failed ...
7 years, 10 months ago (2013-02-05 17:19:18 UTC) #38
Bart N.
+sky@ (for omnibox_edit_model.cc) in case Peter can't reply.
7 years, 10 months ago (2013-02-05 19:18:01 UTC) #39
sky
LGTM https://codereview.chromium.org/12039053/diff/40001/chrome/browser/ui/omnibox/omnibox_edit_model.cc File chrome/browser/ui/omnibox/omnibox_edit_model.cc (right): https://codereview.chromium.org/12039053/diff/40001/chrome/browser/ui/omnibox/omnibox_edit_model.cc#newcode469 chrome/browser/ui/omnibox/omnibox_edit_model.cc:469: // user text. We rely on DisplayTextFromUserText method ...
7 years, 10 months ago (2013-02-05 20:54:08 UTC) #40
Bart N.
Thank you! https://codereview.chromium.org/12039053/diff/40001/chrome/browser/ui/omnibox/omnibox_edit_model.cc File chrome/browser/ui/omnibox/omnibox_edit_model.cc (right): https://codereview.chromium.org/12039053/diff/40001/chrome/browser/ui/omnibox/omnibox_edit_model.cc#newcode469 chrome/browser/ui/omnibox/omnibox_edit_model.cc:469: // user text. We rely on DisplayTextFromUserText ...
7 years, 10 months ago (2013-02-05 21:18:24 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/bartn@chromium.org/12039053/50014
7 years, 10 months ago (2013-02-05 21:20:50 UTC) #42
Mark P
On 2013/02/05 21:20:50, I haz the power (commit-bot) wrote: > CQ is trying da patch. ...
7 years, 10 months ago (2013-02-05 22:23:17 UTC) #43
commit-bot: I haz the power
Change committed as 180826
7 years, 10 months ago (2013-02-05 23:45:43 UTC) #44
Bart N.
On 2013/02/05 23:45:43, I haz the power (commit-bot) wrote: > Change committed as 180826 Mark ...
7 years, 10 months ago (2013-02-05 23:48:23 UTC) #45
Bart N.
On 2013/02/05 23:48:23, Bart N. wrote: > On 2013/02/05 23:45:43, I haz the power (commit-bot) ...
7 years, 10 months ago (2013-02-08 19:12:51 UTC) #46
Bart N.
7 years, 10 months ago (2013-02-08 19:44:26 UTC) #47
Message was sent while issue was closed.
On 2013/02/08 19:12:51, Bart N. wrote:
> On 2013/02/05 23:48:23, Bart N. wrote:
> > On 2013/02/05 23:45:43, I haz the power (commit-bot) wrote:
> > > Change committed as 180826
> > 
> > Mark - I've just noticed your email. I'll sync, re-test and follow up as
> needed.
> I have had a chance to test it today and it looks like chrome://omnibox
crashes
> anytime there is a cursor inside a keyword, e.g.
> 
> FATAL:keyword_provider.cc(164)] Check failed: offset <=
> static_cast<int>(remaining_input.length()) (7 vs. 3)
> 
> The reason why this constraint is violated is because omnibox_ui_handler
doesn't
> have a code that would prevent from sending cursor inside a keyword, which is
> something that we enforce in omnibox_edit_model.cc.
> 
> The solution is either to replace the DCHECK with an if clause or fix Omnibox
UI
> handler.

Further discussion on http://crbug.com/175193.

Powered by Google App Engine
This is Rietveld 408576698