diff options
author | mpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 20:54:44 +0000 |
---|---|---|
committer | mpearson@chromium.org <mpearson@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2014-04-18 20:54:44 +0000 |
commit | a97376ebdf3182f4ccceaa8019deb26829db3688 (patch) | |
tree | 2ab4bc3736d98877dbcb352b1e34d6906b4e8b5c /chrome/browser/extensions/extension_error_controller.cc | |
parent | 9cdbb8cbd23103d00b1f67af2a892b4ac9899b74 (diff) | |
download | chromium_src-a97376ebdf3182f4ccceaa8019deb26829db3688.zip chromium_src-a97376ebdf3182f4ccceaa8019deb26829db3688.tar.gz chromium_src-a97376ebdf3182f4ccceaa8019deb26829db3688.tar.bz2 |
Make FormatUrl Keep Track of Full Transformation
The omnibox providers usually search for matches in the formatted text
(i.e., the escaped characters in the URL are unescaped before searching).
This makes it difficult to highlight matches in URL because the location
of the matched positions does not match the location of the matched
text in the original URL spec. The code to adjust offsets doesn't
help here because it adjusts offsets that with respect to the original
URL spec, not offsets with respect to the formatted URL.
In effect, we need to be able to reverse the transformation that
FormatUrl() does in order to get the original offsets back (if
possible) from the transformed offsets we have.
The easiest and most efficient way to compute this reverse mapping
is to keep track of the full original mapping, then reverse it later
and apply the reversed mapping to the match offsets we have where
the offsets are with respect to the formatted string.
This change include the necessary parts to keep track of the
full transformation.
In a follow-up change, I will make HistoryQuick
provider use the transformation information.
In the process of that change, I will remove the
"WithOffsets" function from net_util.
BUG=252630
Review URL: https://codereview.chromium.org/196103008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@264850 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/extensions/extension_error_controller.cc')
0 files changed, 0 insertions, 0 deletions