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

Issue 255423002: Omnibox: Highlight Matches in URLs Properly (Closed)

Created:
6 years, 8 months ago by Mark P
Modified:
6 years, 7 months ago
CC:
chromium-reviews, tfarina, James Su, erikwright+watch_chromium.org, browser-components-watch_chromium.org, jshin+watch_chromium.org, sdefresne
Visibility:
Public.

Description

Omnibox: Highlight Matches in URLs Properly Previously we'd match the omnibox input against a cleaned-up version of the URL. Precisely, we'd remove the escaping and interpret as UTF8 (and lower-case it) so non-Latin characters can be matched correctly. This is all well and good, but then we'd take the offsets of those matches and use them to highlight segments of the original URL (properly escaped). Oops. At best this caused bad highlighting; at middle, it caused weirdness as we attempted to highlight the middle of a multi-string character; at worst, it'd cause crashes because our offsets calculation would put us in no-man's-land. This fixes all that. :-) Precisely, we keep track of the adjustments made during cleaning. We take the offsets where terms matched and apply them through the transformation in reverse. TBR=sky (as usual for history and bookmarks stuff that just change internals relative to how they behave with the omnibox) BUG=252630, 359270 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=266630

Patch Set 1 #

Patch Set 2 : spacing #

Total comments: 14

Patch Set 3 : Peter's comments #

Total comments: 8

Patch Set 4 : Peter's comments #

Total comments: 3

Patch Set 5 : remove unnecessary includes #

Patch Set 6 : add casts #

Patch Set 7 : add missing include #

Patch Set 8 : rebase #

Patch Set 9 : apparently unit tests aren't always run in debug mode #

Patch Set 10 : fix OffsetsFromTermMatches test #

Unified diffs Side-by-side diffs Delta from patch set Stats (+264 lines, -103 lines) Patch
M base/strings/utf_offset_string_conversions.h View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M base/strings/utf_offset_string_conversions.cc View 1 2 3 4 5 2 chunks +33 lines, -2 lines 0 comments Download
M base/strings/utf_offset_string_conversions_unittest.cc View 1 chunk +58 lines, -0 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider.cc View 1 2 3 4 5 6 7 1 chunk +13 lines, -18 lines 0 comments Download
M chrome/browser/autocomplete/history_quick_provider_unittest.cc View 1 2 3 4 5 6 7 8 3 chunks +38 lines, -1 line 0 comments Download
M chrome/browser/bookmarks/bookmark_index.cc View 1 2 3 4 5 6 7 5 chunks +18 lines, -8 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_index_unittest.cc View 1 2 3 4 5 6 7 2 chunks +24 lines, -14 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_utils.h View 1 2 3 2 chunks +23 lines, -10 lines 0 comments Download
M chrome/browser/bookmarks/bookmark_utils.cc View 1 2 3 4 5 6 7 1 chunk +7 lines, -4 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_types.h View 1 2 3 4 1 chunk +8 lines, -3 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_types.cc View 1 2 3 4 5 2 chunks +13 lines, -37 lines 0 comments Download
M chrome/browser/history/in_memory_url_index_types_unittest.cc View 1 2 3 4 5 6 7 8 9 1 chunk +2 lines, -2 lines 0 comments Download
M chrome/browser/history/scored_history_match.cc View 2 chunks +10 lines, -1 line 0 comments Download
M chrome/browser/history/url_index_private_data.cc View 1 2 2 chunks +3 lines, -3 lines 0 comments Download

Messages

Total messages: 45 (0 generated)
Mark P
The culmination of the big FormatUrl() changelist. A nice visual improvement for our non-Latin users. ...
6 years, 8 months ago (2014-04-23 22:45:37 UTC) #1
Peter Kasting
I'm a little confused at the sequence of adjusting and unadjusting offsets. Are we formatting ...
6 years, 8 months ago (2014-04-23 23:18:01 UTC) #2
Mark P
On Wed, Apr 23, 2014 at 4:18 PM, <pkasting@chromium.org> wrote: > I'm a little confused ...
6 years, 8 months ago (2014-04-23 23:36:14 UTC) #3
Peter Kasting
On 2014/04/23 23:36:14, Mark P wrote: > On Wed, Apr 23, 2014 at 4:18 PM, ...
6 years, 8 months ago (2014-04-23 23:37:43 UTC) #4
Mark P
On Wed, Apr 23, 2014 at 4:37 PM, <pkasting@chromium.org> wrote: > On 2014/04/23 23:36:14, Mark ...
6 years, 8 months ago (2014-04-23 23:41:47 UTC) #5
Peter Kasting
On 2014/04/23 23:41:47, Mark P wrote: > On Wed, Apr 23, 2014 at 4:37 PM, ...
6 years, 8 months ago (2014-04-23 23:44:30 UTC) #6
Mark P
On Wed, Apr 23, 2014 at 4:44 PM, <pkasting@chromium.org> wrote: > On 2014/04/23 23:41:47, Mark ...
6 years, 8 months ago (2014-04-24 13:26:56 UTC) #7
Mark P
https://codereview.chromium.org/255423002/diff/20001/base/strings/utf_offset_string_conversions.h File base/strings/utf_offset_string_conversions.h (right): https://codereview.chromium.org/255423002/diff/20001/base/strings/utf_offset_string_conversions.h#newcode64 base/strings/utf_offset_string_conversions.h:64: size_t* offset_for_unadjustment); On 2014/04/23 23:18:01, Peter Kasting wrote: > ...
6 years, 8 months ago (2014-04-24 14:05:02 UTC) #8
Peter Kasting
LGTM https://codereview.chromium.org/255423002/diff/40001/chrome/browser/autocomplete/history_quick_provider_unittest.cc File chrome/browser/autocomplete/history_quick_provider_unittest.cc (right): https://codereview.chromium.org/255423002/diff/40001/chrome/browser/autocomplete/history_quick_provider_unittest.cc#newcode387 chrome/browser/autocomplete/history_quick_provider_unittest.cc:387: // five offsets to be correct--in this example ...
6 years, 8 months ago (2014-04-24 21:00:51 UTC) #9
Mark P
https://codereview.chromium.org/255423002/diff/40001/chrome/browser/autocomplete/history_quick_provider_unittest.cc File chrome/browser/autocomplete/history_quick_provider_unittest.cc (right): https://codereview.chromium.org/255423002/diff/40001/chrome/browser/autocomplete/history_quick_provider_unittest.cc#newcode387 chrome/browser/autocomplete/history_quick_provider_unittest.cc:387: // five offsets to be correct--in this example tthese ...
6 years, 8 months ago (2014-04-24 23:05:17 UTC) #10
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 8 months ago (2014-04-24 23:18:19 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/60001
6 years, 8 months ago (2014-04-24 23:21:45 UTC) #12
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-24 23:30:38 UTC) #13
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on chromium_presubmit
6 years, 8 months ago (2014-04-24 23:30:38 UTC) #14
Mark P
willchan, can please approve the change to base/strings/...? pkasting has already reviewed this. thanks, mark
6 years, 8 months ago (2014-04-25 00:03:01 UTC) #15
willchan no longer on Chromium
Only have some quick questions. https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc File base/strings/utf_offset_string_conversions.cc (right): https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc#newcode40 base/strings/utf_offset_string_conversions.cc:40: int adjustment = 0; ...
6 years, 8 months ago (2014-04-25 00:07:20 UTC) #16
Mark P
https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc File base/strings/utf_offset_string_conversions.cc (right): https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc#newcode40 base/strings/utf_offset_string_conversions.cc:40: int adjustment = 0; On 2014/04/25 00:07:20, willchan wrote: ...
6 years, 8 months ago (2014-04-25 02:29:02 UTC) #17
willchan no longer on Chromium
lgtm https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc File base/strings/utf_offset_string_conversions.cc (right): https://codereview.chromium.org/255423002/diff/60001/base/strings/utf_offset_string_conversions.cc#newcode40 base/strings/utf_offset_string_conversions.cc:40: int adjustment = 0; On 2014/04/25 02:29:02, Mark ...
6 years, 8 months ago (2014-04-25 05:24:42 UTC) #18
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 8 months ago (2014-04-25 17:09:15 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/80001
6 years, 8 months ago (2014-04-25 21:46:31 UTC) #20
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-25 22:33:52 UTC) #21
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel tryserver.chromium on linux_chromium_rel
6 years, 8 months ago (2014-04-25 22:33:52 UTC) #22
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 8 months ago (2014-04-26 03:47:42 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/100001
6 years, 8 months ago (2014-04-26 03:51:02 UTC) #24
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-26 04:51:13 UTC) #25
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 8 months ago (2014-04-26 04:51:14 UTC) #26
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 8 months ago (2014-04-28 00:32:12 UTC) #27
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/120001
6 years, 8 months ago (2014-04-28 00:32:44 UTC) #28
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-04-28 00:33:02 UTC) #29
commit-bot: I haz the power
Failed to apply patch for chrome/browser/bookmarks/bookmark_index.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-04-28 00:33:02 UTC) #30
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 7 months ago (2014-04-28 14:09:35 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/140001
6 years, 7 months ago (2014-04-28 14:09:47 UTC) #32
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 14:28:35 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_rel
6 years, 7 months ago (2014-04-28 14:28:35 UTC) #34
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 7 months ago (2014-04-28 14:36:17 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/160001
6 years, 7 months ago (2014-04-28 14:36:28 UTC) #36
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 15:47:35 UTC) #37
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 7 months ago (2014-04-28 15:47:35 UTC) #38
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 7 months ago (2014-04-28 17:03:28 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/180001
6 years, 7 months ago (2014-04-28 17:04:28 UTC) #40
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-04-28 17:11:48 UTC) #41
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_rel
6 years, 7 months ago (2014-04-28 17:11:49 UTC) #42
Mark P
The CQ bit was checked by mpearson@chromium.org
6 years, 7 months ago (2014-04-28 17:13:40 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mpearson@chromium.org/255423002/180001
6 years, 7 months ago (2014-04-28 17:15:50 UTC) #44
commit-bot: I haz the power
6 years, 7 months ago (2014-04-28 19:37:25 UTC) #45
Message was sent while issue was closed.
Change committed as 266630

Powered by Google App Engine
This is Rietveld 408576698