Commit 55a79246 authored by Jenny Zhang's avatar Jenny Zhang Committed by Commit Bot

Skip updating autocomplete text only if the new and old one are identical.

Bug: 967818
Change-Id: I009a0edfd3b5f644fefe8e722556848b5c996b25
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1633029Reviewed-by: default avatarXiyuan Xia <xiyuan@chromium.org>
Commit-Queue: Jenny Zhang <jennyz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664398}
parent 2816cc86
...@@ -512,7 +512,7 @@ void SearchBoxView::SetAutocompleteText( ...@@ -512,7 +512,7 @@ void SearchBoxView::SetAutocompleteText(
DCHECK(base::StartsWith(autocomplete_text, current_text, DCHECK(base::StartsWith(autocomplete_text, current_text,
base::CompareCase::INSENSITIVE_ASCII)); base::CompareCase::INSENSITIVE_ASCII));
// Don't set autocomplete text if it's the same as current search box text. // Don't set autocomplete text if it's the same as current search box text.
if (autocomplete_text.length() == current_text.length()) if (autocomplete_text == current_text)
return; return;
const base::string16& highlighted_text = const base::string16& highlighted_text =
......
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