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

Issue 10824261: Fix handling of inline autocomplete text vis-a-vis Instant. (Closed)

Created:
8 years, 4 months ago by sreeram
Modified:
8 years, 4 months ago
CC:
chromium-reviews
Visibility:
Public.

Description

Fix handling of inline autocomplete text vis-a-vis Instant. Consider the following scenario: 1. Type "g" in the omnibox. --> The omnibox inline autocompletes "oogle.com". 2. Hit Tab. --> You're now in keyword mode. Here, inline_autocomplete_text_ is still "oogle.com", though the display text is a blank string. The previous code caused a crash. Now, we check properly that the inline text is a suffix of the display text. Arguably, the inline text should always be a suffix of the display text, say by clearing it in OmniboxEditModel::AcceptKeyword(): http://crbug.com/141890 R=pkasting@google.com BUG=141878 TEST=Scenario in CL description above shouldn't crash. Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=151146

Patch Set 1 #

Patch Set 2 : Actually builds now. #

Patch Set 3 : Use model text instead of view text #

Total comments: 2

Patch Set 4 : Updated comment #

Unified diffs Side-by-side diffs Delta from patch set Stats (+20 lines, -13 lines) Patch
M chrome/browser/ui/omnibox/omnibox_edit_model.cc View 1 2 3 2 chunks +20 lines, -13 lines 0 comments Download

Messages

Total messages: 10 (0 generated)
sreeram
8 years, 4 months ago (2012-08-10 18:35:22 UTC) #1
sreeram
Peter, it turns out I can't use user_text_ (or DisplayTextFromUserText) for sending the query to ...
8 years, 4 months ago (2012-08-10 18:37:33 UTC) #2
Peter Kasting
This still uses GetText(). I don't think you should do that. I'm not clear on ...
8 years, 4 months ago (2012-08-10 19:01:57 UTC) #3
Peter Kasting
On 2012/08/10 18:37:33, sreeram wrote: > Peter, it turns out I can't use user_text_ (or ...
8 years, 4 months ago (2012-08-10 19:04:39 UTC) #4
Peter Kasting
In fact in general you should be checking those anyway. If you have temporary text, ...
8 years, 4 months ago (2012-08-10 19:07:37 UTC) #5
sreeram
On 2012/08/10 19:01:57, Peter Kasting wrote: > I'm not clear on what this code is ...
8 years, 4 months ago (2012-08-10 19:21:47 UTC) #6
Peter Kasting
FWIW I think other places in the model that use GetText() may also be wrong. ...
8 years, 4 months ago (2012-08-10 20:12:24 UTC) #7
sreeram
On 2012/08/10 20:12:24, Peter Kasting wrote: > I'd suggest the following pattern here: > > ...
8 years, 4 months ago (2012-08-10 21:36:16 UTC) #8
Peter Kasting
LGTM http://codereview.chromium.org/10824261/diff/3002/chrome/browser/ui/omnibox/omnibox_edit_model.cc File chrome/browser/ui/omnibox/omnibox_edit_model.cc (right): http://codereview.chromium.org/10824261/diff/3002/chrome/browser/ui/omnibox/omnibox_edit_model.cc#newcode1129 chrome/browser/ui/omnibox/omnibox_edit_model.cc:1129: // If the user has selected some other ...
8 years, 4 months ago (2012-08-10 21:39:10 UTC) #9
sreeram
8 years, 4 months ago (2012-08-10 22:34:13 UTC) #10
http://codereview.chromium.org/10824261/diff/3002/chrome/browser/ui/omnibox/o...
File chrome/browser/ui/omnibox/omnibox_edit_model.cc (right):

http://codereview.chromium.org/10824261/diff/3002/chrome/browser/ui/omnibox/o...
chrome/browser/ui/omnibox/omnibox_edit_model.cc:1129: // If the user has
selected some other text (say from the drop down), use
On 2012/08/10 21:39:10, Peter Kasting wrote:
> Nit: Change to:
> 
> If there's temporary text, that overrides the user_text.  In this case we
should
> ignore any inline_autocomplete_text_, because it won't be visible.

Done.

Powered by Google App Engine
This is Rietveld 408576698