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

Issue 5607003: Make chrome.omnibox.setDefaultSuggestion work when called inside (Closed)

Created:
10 years ago by Matt Perry
Modified:
9 years, 7 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, Aaron Boodman, Erik does not do reviews, pam+watch_chromium.org, ben+cc_chromium.org
Visibility:
Public.

Description

Make chrome.omnibox.setDefaultSuggestion work when called inside onInputChanged. BUG=64538 TEST=Use the chrome_search sample extension and make sure the first suggestion updates in sync with what you type. Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=68411

Patch Set 1 #

Patch Set 2 : comments #

Total comments: 8

Patch Set 3 : nits #

Unified diffs Side-by-side diffs Delta from patch set Stats (+79 lines, -45 lines) Patch
M chrome/browser/autocomplete/keyword_provider.cc View 1 2 2 chunks +70 lines, -45 lines 0 comments Download
M chrome/browser/extensions/extension_omnibox_api.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M chrome/common/notification_type.h View 1 1 chunk +4 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Matt Perry
10 years ago (2010-12-04 02:22:35 UTC) #1
Peter Kasting
LGTM http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/keyword_provider.cc File chrome/browser/autocomplete/keyword_provider.cc (right): http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/keyword_provider.cc#newcode447 chrome/browser/autocomplete/keyword_provider.cc:447: break; Nit: Using "return" instead of "break" makes ...
10 years ago (2010-12-06 20:05:53 UTC) #2
Matt Perry
10 years ago (2010-12-07 00:10:18 UTC) #3
http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/...
File chrome/browser/autocomplete/keyword_provider.cc (right):

http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/...
chrome/browser/autocomplete/keyword_provider.cc:447: break;
On 2010/12/06 20:05:53, Peter Kasting wrote:
> Nit: Using "return" instead of "break" makes life a little easier on the
reader
> (I don't have to scan through the rest of the code looking for post-switch
> functionality).  (3 places)

Done.

http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/...
chrome/browser/autocomplete/keyword_provider.cc:454:
!ExtractKeywordFromInput(input, &keyword, &remaining_input))
On 2010/12/06 20:05:53, Peter Kasting wrote:
> Is ExtractKeywordFromInput() supposed to guaranteed-succeed here, like in
> EXTENSION_OMNIBOX_SUGGESTIONS_READY below?

I *think* it should as long as the first 2 clauses of the conditional are false,
but I wasn't entirely sure about all the edge cases.

http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/...
chrome/browser/autocomplete/keyword_provider.cc:471: // TODO(mpcomplete):
consider clamping the number of suggestions to
On 2010/12/06 20:05:53, Peter Kasting wrote:
> Nit: Doesn't this TODO belong on the next block?  Also, why not go ahead and
> implement this?

I've moved the TODO. I think I'm going to wait until
http://code.google.com/p/chromium/issues/detail?id=56705 is fixed before doing
anything here.

http://codereview.chromium.org/5607003/diff/2001/chrome/browser/autocomplete/...
chrome/browser/autocomplete/keyword_provider.cc:481: suggestions.suggestions[i];
On 2010/12/06 20:05:53, Peter Kasting wrote:
> Nit: You could probably avoid this temp by using an iterator in the loop. 
(Then
> it would be "i->" instead of "suggestion.".)

I also need the index for the relevance calculation below.

Powered by Google App Engine
This is Rietveld 408576698