Commit 6c74cdcf authored by Tommy C. Li's avatar Tommy C. Li Committed by Commit Bot

Omnibox UI Experiments: Steady State Elisions - don't re-elide on alt-tab

Previously, when the user placed the cursor in the URL and unelided the
URL, and then pressed Alt-Tab to switch windows, and then to switch
back, the URL would be re-elided.

This is not desirable. The Omnibox state should not change merely from
switching windows. It should re-elide only if the user focuses something
else in the same window.

This CL fixes the bug and adds a test for this behavior.

It also updates the test to make failure messages more clear about
which line has the failing condition.

Bug: 797354
Change-Id: I43905e1248c439651bd6b6a66d57d46dff0989e2
Reviewed-on: https://chromium-review.googlesource.com/1014347
Commit-Queue: Tommy Li <tommycli@chromium.org>
Reviewed-by: default avatarJustin Donnelly <jdonnelly@chromium.org>
Cr-Commit-Position: refs/heads/master@{#551158}
parent e47822a1
......@@ -925,7 +925,12 @@ void OmniboxViewViews::OnBlur() {
// Revert the URL if the user has not made any changes. If steady-state
// elisions is on, this will also re-elide the URL.
if (model()->user_input_in_progress() &&
//
// Because merely Alt-Tabbing to another window and back should not change the
// Omnibox state, we only revert the text only if the Omnibox is blurred in
// favor of some other View in the same Widget.
if (GetWidget() && GetWidget()->IsActive() &&
model()->user_input_in_progress() &&
text() == model()->GetCurrentPermanentUrlText()) {
RevertAll();
}
......
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