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

Issue 67693004: Omnibox: Don't Let Users Escape Keyword Mode Accidentally (Closed)

Created:
7 years, 1 month ago by Mark P
Modified:
7 years, 1 month ago
Reviewers:
msw, Peter Kasting
CC:
chromium-reviews, James Su
Visibility:
Public.

Description

Omnibox: Don't Let Users Escape Keyword Mode Accidentally The current code already protects against users escaping keyword mode accidentally in regular (non-reorder mode). This change simply adds the proper annotations so reorder mode has the protection as well. There are three parts to this change: * Mark navsuggestions as "not allowed to be default match" if the user is in keyword mode. Revise tests to reflect this. * Add a constraint that, in keyword mode, there must be at least one keyword (query) suggestion that be the default match. Restore the keyword verbatim if the constraint is violated. Revise tests to reflect this. * As a post-processing step, if there is at least one keyword mode match that can be default [1], mark all matches from other sources (e.g., the default search engine) as not allowed to be the default match. Revise tests to reflect this. [1] Given the second bullet (the constraint), you might wonder why it could be the case that there might not be a keyword mode match that can be default. The reason for this criteria is that the user could be in keyword mode for a keyword extension or some such thing, but we can't trust KeywordProvider to always make a default match in those cases. For instance, the extension could be disabled. Hence, we maintain the invariant that SearchProvider always returns a match that can be default, even if needs to back off to the default provider match to do so. By the way, the regular mode protection works as follows: (i) demote all navsuggestions past the score of the top query when in keyword mode (ii) abandon suggested relevance scores on the default provider, meaning the top result from the default provider will score 250 when in keyword mode (iii) enforce a constraint that a match (thus implicitly a keyword mode match) must score at least 850 Together, these constraints (and the way it fixes the violations) guarantee that a query from the keyword provider comes first in regular (non-reorder mode). BUG=317946, 318543 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=236777

Patch Set 1 #

Total comments: 7

Patch Set 2 : tweaks #

Patch Set 3 : new approach #

Total comments: 1

Patch Set 4 : fix incorrect comment #

Total comments: 12

Patch Set 5 : Peter's latest comments #

Total comments: 24

Patch Set 6 : Mike's comments #

Total comments: 4

Patch Set 7 : namespace #

Unified diffs Side-by-side diffs Delta from patch set Stats (+267 lines, -197 lines) Patch
M chrome/browser/autocomplete/search_provider.h View 1 2 3 4 5 1 chunk +1 line, -0 lines 0 comments Download
M chrome/browser/autocomplete/search_provider.cc View 1 2 3 4 5 5 chunks +45 lines, -7 lines 0 comments Download
M chrome/browser/autocomplete/search_provider_unittest.cc View 1 2 3 4 5 6 64 chunks +221 lines, -190 lines 0 comments Download

Messages

Total messages: 22 (0 generated)
Mark P
Hi Peter, This might be my last change to SearchProvider for reorder mode. Please take ...
7 years, 1 month ago (2013-11-14 22:56:39 UTC) #1
Peter Kasting
https://codereview.chromium.org/67693004/diff/1/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/1/chrome/browser/autocomplete/search_provider.cc#newcode1298 chrome/browser/autocomplete/search_provider.cc:1298: // When in keyword mode, make sure all matches ...
7 years, 1 month ago (2013-11-15 03:03:34 UTC) #2
Mark P
Lots of things to think about here... --mark https://codereview.chromium.org/67693004/diff/1/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/1/chrome/browser/autocomplete/search_provider.cc#newcode1298 chrome/browser/autocomplete/search_provider.cc:1298: // ...
7 years, 1 month ago (2013-11-15 17:36:33 UTC) #3
Peter Kasting
On 2013/11/15 17:36:33, Mark P wrote: > CONCLUSION: Here's my proposal after thinking through your ...
7 years, 1 month ago (2013-11-15 22:22:24 UTC) #4
Mark P
On Fri, Nov 15, 2013 at 2:22 PM, <pkasting@chromium.org> wrote: > On 2013/11/15 17:36:33, Mark ...
7 years, 1 month ago (2013-11-15 22:35:12 UTC) #5
Peter Kasting
On 2013/11/15 22:35:12, Mark P wrote: > > I'm confused. How does the rolling back ...
7 years, 1 month ago (2013-11-15 22:38:16 UTC) #6
Mark P
On Fri, Nov 15, 2013 at 2:38 PM, <pkasting@chromium.org> wrote: > On 2013/11/15 22:35:12, Mark ...
7 years, 1 month ago (2013-11-15 22:58:28 UTC) #7
Peter Kasting
OK, SGTM I guess. This would also avoid having the bug I mentioned above trigger ...
7 years, 1 month ago (2013-11-15 23:01:14 UTC) #8
Mark P
Hi Peter, I implemented the new approach that we discussed. Please tell me what you ...
7 years, 1 month ago (2013-11-17 02:18:34 UTC) #9
Mark P
FYI, rewrote changelist description.
7 years, 1 month ago (2013-11-18 15:42:50 UTC) #10
Peter Kasting
I confess, for some reason my brain is refusing to wrap itself around this change ...
7 years, 1 month ago (2013-11-19 02:58:24 UTC) #11
Mark P
Because you're nervous, I'm going to ask Mike to review this as well. --mark https://codereview.chromium.org/67693004/diff/230001/chrome/browser/autocomplete/search_provider.cc ...
7 years, 1 month ago (2013-11-20 19:05:52 UTC) #12
Mark P
Hi Mike, You're the expert on SearchProvider constraints. Can you please review this? Peter's not ...
7 years, 1 month ago (2013-11-20 19:08:18 UTC) #13
msw
This seems mostly good; my comments are mostly minor. https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc#newcode1310 chrome/browser/autocomplete/search_provider.cc:1310: ...
7 years, 1 month ago (2013-11-20 21:05:03 UTC) #14
Peter Kasting
I don't know if I agree with Mike's desires to fold the "in keyword mode" ...
7 years, 1 month ago (2013-11-20 21:43:46 UTC) #15
Mark P
Mike, please take another look. thanks, mark https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc#newcode1310 chrome/browser/autocomplete/search_provider.cc:1310: bool SearchProvider::IsTopMatchNavigation( ...
7 years, 1 month ago (2013-11-21 21:30:22 UTC) #16
msw
LGTM with a couple new nits. https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc#newcode1406 chrome/browser/autocomplete/search_provider.cc:1406: DCHECK(!IsTopMatchNavigation( On 2013/11/21 ...
7 years, 1 month ago (2013-11-21 22:11:10 UTC) #17
Mark P
https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc File chrome/browser/autocomplete/search_provider.cc (right): https://codereview.chromium.org/67693004/diff/310001/chrome/browser/autocomplete/search_provider.cc#newcode1406 chrome/browser/autocomplete/search_provider.cc:1406: DCHECK(!IsTopMatchNavigation( On 2013/11/21 22:11:11, msw wrote: > On 2013/11/21 ...
7 years, 1 month ago (2013-11-22 01:17:57 UTC) #18
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/67693004/470001
7 years, 1 month ago (2013-11-22 01:21:02 UTC) #19
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=193632
7 years, 1 month ago (2013-11-22 03:11:17 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/67693004/470001
7 years, 1 month ago (2013-11-22 15:28:50 UTC) #21
commit-bot: I haz the power
7 years, 1 month ago (2013-11-22 16:28:19 UTC) #22
Message was sent while issue was closed.
Change committed as 236777

Powered by Google App Engine
This is Rietveld 408576698