Commit 8b87ff22 authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox UI Experiments: Steady State Elisions - Replace TODO w/ comment

Looking back on this TODO, I think using the FormatURL offsets is
overkill, requires a lot of plumbing, and confusing for the maintainer
compared to this "simple" logic.

So I'm deleting the TODO and replacing it with a comment that explains
why we can use the "simple" logic and when we would have to replace it.

Bug: 797354
Change-Id: Idffe358c054fb2f70a4bd91c928af324b1edf650
Reviewed-on: https://chromium-review.googlesource.com/1014394Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Commit-Queue: Tommy Li <tommycli@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551168}
parent c2c5dcb1
......@@ -545,8 +545,9 @@ bool OmniboxViewViews::UnapplySteadyStateElisions(bool home_key_pressed) {
size_t start, end;
GetSelectionBounds(&start, &end);
// TODO(tommycli): Before this code goes into production, investigate
// whether using the offsets provided by FormatURL makes more sense.
// Find the length of the prefix that was chopped off to form the elided URL.
// This simple logic only works because we elide only prefixes from the full
// URL. Otherwise, we would have to use the FormatURL offset adjustments.
size_t offset = full_url.find(GetText());
if (offset != base::string16::npos) {
start += offset;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment