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

Issue 353223002: Omnibox: Fix URL-What-You-Typed Allowed-To-Be-Default-Match Issues (Closed)

Created:
6 years, 5 months ago by Mark P
Modified:
6 years, 5 months ago
Reviewers:
Peter Kasting
CC:
chromium-reviews, James Su
Project:
chromium
Visibility:
Public.

Description

Omnibox: Fix URL-What-You-Typed Allowed-To-Be-Default-Match Issues The two linked bugs both describe situations where the user types a URL but that URL does not appear first because the top-scoring provider that returned the URL set it incorrectly as not allowed to be the default match. This changes fixes those issues by making providers (namely HistoryQuick, Search, and Shortcuts) mark a match as allowed_to_be_default_match if it is UWYT match for this input, or (even if not identical) it would be dedupped against the UWYT match. The changes to HistoryQuick and Search fix the attached bugs. Shortcuts does the identical part of the test, not the de-dupping part of the test. The Shortcuts change to handle dedupping is not to fix a known bug; rather it's simply to make Shortcuts behave as it should and in parallel with the other providers. I don't think changes in other providers beyond these three are necessary. This change necessitated some changes to AutocompleteMatch to make a statically-available version of ComputeStrippedDestinationURL() so we can strip URLs (such as the UWYT URL) that isn't going to be a AutocompleteMatch in the relevant provider. Also removes the IsInlineable() function in BaseSearchProvider::Result, which is only used in one place and not actually necessary in that place. (It's computing the same thing that code there is already computing.) BUG=383065, 388397 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=282669

Patch Set 1 #

Patch Set 2 : polish #

Total comments: 16

Patch Set 3 : Peter's comments, minus getting rid of Profile #

Patch Set 4 : rebase and make compile; not re-tested #

Patch Set 5 : refactor to add common function, plus add tests #

Patch Set 6 : remove extra << #

Total comments: 14

Patch Set 7 : Peter's comments #

Patch Set 8 : remove some test cases; add dcheck #

Total comments: 4

Patch Set 9 : Peter's comments #

Patch Set 10 : rebase #

Patch Set 11 : fix crashes on about: schemes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+166 lines, -84 lines) Patch
M chrome/browser/autocomplete/autocomplete_match.h View 1 2 3 4 5 6 7 8 9 1 chunk +32 lines, -9 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_match.cc View 1 2 3 4 5 6 7 8 9 3 chunks +48 lines, -15 lines 0 comments Download
M chrome/browser/autocomplete/autocomplete_result.cc View 1 2 3 4 5 6 7 8 9 10 2 chunks +13 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/base_search_provider.h View 1 2 3 4 5 6 7 8 9 3 chunks +0 lines, -6 lines 0 comments Download
M chrome/browser/autocomplete/base_search_provider.cc View 1 2 3 4 5 6 7 8 9 2 chunks +0 lines, -11 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 3 chunks +47 lines, -7 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 2 3 4 5 6 7 8 9 1 chunk +3 lines, -1 line 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +7 lines, -12 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider.h View 1 2 3 4 5 6 7 8 9 1 chunk +4 lines, -5 lines 0 comments Download
M chrome/browser/autocomplete/shortcuts_provider.cc View 1 2 3 4 5 6 7 8 9 4 chunks +9 lines, -18 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Mark P
Hi Peter, Here's the solution we discussed. Please take a look. If you like it, ...
6 years, 5 months ago (2014-06-27 21:32:11 UTC) #1
Peter Kasting
https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/autocomplete_match.cc File chrome/browser/autocomplete/autocomplete_match.cc (right): https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/autocomplete_match.cc#newcode350 chrome/browser/autocomplete/autocomplete_match.cc:350: const GURL& url, Profile* profile, const base::string16& keyword) { ...
6 years, 5 months ago (2014-06-30 23:02:58 UTC) #2
Mark P
https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/autocomplete_match.cc File chrome/browser/autocomplete/autocomplete_match.cc (right): https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/autocomplete_match.cc#newcode350 chrome/browser/autocomplete/autocomplete_match.cc:350: const GURL& url, Profile* profile, const base::string16& keyword) { ...
6 years, 5 months ago (2014-06-30 23:27:37 UTC) #3
Peter Kasting
https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc File chrome/browser/autocomplete/shortcuts_provider.cc (right): https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc#newcode254 chrome/browser/autocomplete/shortcuts_provider.cc:254: url_fixer::FixupURL(base::UTF16ToUTF8(match.fill_into_edit), On 2014/06/30 23:27:36, Mark P wrote: > On ...
6 years, 5 months ago (2014-06-30 23:31:25 UTC) #4
Mark P
https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc File chrome/browser/autocomplete/shortcuts_provider.cc (right): https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc#newcode254 chrome/browser/autocomplete/shortcuts_provider.cc:254: url_fixer::FixupURL(base::UTF16ToUTF8(match.fill_into_edit), On 2014/06/30 23:31:25, Peter Kasting wrote: > On ...
6 years, 5 months ago (2014-07-01 17:45:33 UTC) #5
Peter Kasting
On 2014/07/01 17:45:33, Mark P wrote: > https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc > File chrome/browser/autocomplete/shortcuts_provider.cc (right): > > https://codereview.chromium.org/353223002/diff/20001/chrome/browser/autocomplete/shortcuts_provider.cc#newcode254 ...
6 years, 5 months ago (2014-07-01 18:01:14 UTC) #6
Mark P
Peter, I refactored this to use a common function that lives in AutocompleteMatch as we ...
6 years, 5 months ago (2014-07-07 23:25:59 UTC) #7
Peter Kasting
https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/autocomplete_match.cc File chrome/browser/autocomplete/autocomplete_match.cc (right): https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/autocomplete_match.cc#newcode352 chrome/browser/autocomplete/autocomplete_match.cc:352: TemplateURL* template_url = keyword.empty() ? NULL : Nit: Break ...
6 years, 5 months ago (2014-07-09 00:46:43 UTC) #8
Mark P
New snapup, and replies (including one long one) to your comments. --mark https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/autocomplete_match.cc File chrome/browser/autocomplete/autocomplete_match.cc ...
6 years, 5 months ago (2014-07-09 19:54:17 UTC) #9
Peter Kasting
https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/search_provider_unittest.cc File chrome/browser/autocomplete/search_provider_unittest.cc (right): https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/search_provider_unittest.cc#newcode2211 chrome/browser/autocomplete/search_provider_unittest.cc:2211: true }, On 2014/07/09 19:54:17, Mark P wrote: > ...
6 years, 5 months ago (2014-07-09 21:05:03 UTC) #10
Mark P
https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/search_provider_unittest.cc File chrome/browser/autocomplete/search_provider_unittest.cc (right): https://codereview.chromium.org/353223002/diff/100001/chrome/browser/autocomplete/search_provider_unittest.cc#newcode2211 chrome/browser/autocomplete/search_provider_unittest.cc:2211: true }, On 2014/07/09 21:05:03, Peter Kasting wrote: > ...
6 years, 5 months ago (2014-07-09 22:31:37 UTC) #11
Peter Kasting
LGTM https://codereview.chromium.org/353223002/diff/140001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/353223002/diff/140001/chrome/browser/autocomplete/autocomplete_result.cc#newcode272 chrome/browser/autocomplete/autocomplete_result.cc:272: DCHECK_EQ(base::UTF16ToUTF8(base::i18n::ToLower(input.scheme())), This isn't already lowercased for us? https://codereview.chromium.org/353223002/diff/140001/chrome/browser/autocomplete/history_quick_provider.cc ...
6 years, 5 months ago (2014-07-09 22:36:00 UTC) #12
Mark P
https://codereview.chromium.org/353223002/diff/140001/chrome/browser/autocomplete/autocomplete_result.cc File chrome/browser/autocomplete/autocomplete_result.cc (right): https://codereview.chromium.org/353223002/diff/140001/chrome/browser/autocomplete/autocomplete_result.cc#newcode272 chrome/browser/autocomplete/autocomplete_result.cc:272: DCHECK_EQ(base::UTF16ToUTF8(base::i18n::ToLower(input.scheme())), On 2014/07/09 22:36:00, Peter Kasting wrote: > This ...
6 years, 5 months ago (2014-07-09 23:12:23 UTC) #13
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 5 months ago (2014-07-09 23:12:30 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/353223002/160001
6 years, 5 months ago (2014-07-09 23:13:53 UTC) #15
commit-bot: I haz the power
FYI, CQ is re-trying this CL (attempt #1). The failing builders are: linux_chromium_chromeos_rel on tryserver.chromium ...
6 years, 5 months ago (2014-07-10 03:49:06 UTC) #16
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 5 months ago (2014-07-10 04:56:02 UTC) #17
commit-bot: I haz the power
Try jobs failed on following builders: linux_chromium_chromeos_rel on tryserver.chromium (http://build.chromium.org/p/tryserver.chromium/builders/linux_chromium_chromeos_rel/builds/46197)
6 years, 5 months ago (2014-07-10 04:56:02 UTC) #18
Mark P
The failure was real. The scheme equality was a little too aggressive for about: schemes. ...
6 years, 5 months ago (2014-07-11 17:38:35 UTC) #19
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 5 months ago (2014-07-11 17:38:43 UTC) #20
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/353223002/200001
6 years, 5 months ago (2014-07-11 17:40:04 UTC) #21
commit-bot: I haz the power
6 years, 5 months ago (2014-07-11 19:46:39 UTC) #22
Message was sent while issue was closed.
Change committed as 282669

Powered by Google App Engine
This is Rietveld 408576698