Commit caf08029 authored by Alice Boxhall's avatar Alice Boxhall Committed by Commit Bot

Revert "[omnibox] [rich-autocompletion] Unelide omnibox before setting focus."

This reverts commit f28b7fc7.

Reason for revert: Seems to have caused breakages of tests:
LookalikeUrlTestCase/testLookalikeUrlPageNoSuggestionClosePage
LookalikeUrlTestCase/testLookalikeUrlPageNoSuggestion

Flake dashboard: https://test-results.appspot.com/dashboards/flakiness_dashboard.html#testType=ios_chrome_web_eg2tests_module_iPhone%20(with%20patch)&tests=LookalikeUrlTestCase/testLookalikeUrlPageNoSuggestion


Original change's description:
> [omnibox] [rich-autocompletion] Unelide omnibox before setting focus.
> 
> With the 1-line UI, rich autocompletion adds a label adjacent to the
> omnibox and then resizes the two as the autocompletion length changes.
> 
> On location bar focus, the omnibox is unelided; e.g. google.com is
> unelided to https://www.google.com.
> 
> Before this CL, unelision occurs *after* the location bar is given focus
> and its layout computed.
> 
> With this CL, unelision occurs *before* the location bar is given focus
> so that it can reserve sufficient width for the unelided URL when
> updating its layout.
> 
> Bug: 1062446
> Change-Id: Id78d635255de69d9af97a5589a9e001eee3d0feb
> Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2304666
> Commit-Queue: manuk hovanesian <manukh@chromium.org>
> Reviewed-by: Tommy Li <tommycli@chromium.org>
> Cr-Commit-Position: refs/heads/master@{#789698}

TBR=tommycli@chromium.org,manukh@chromium.org

# Not skipping CQ checks because original CL landed > 1 day ago.

Bug: 1062446
Change-Id: I0e46e30a07082a3ebb239dd6d05c65d46de64fd8
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2306136Reviewed-by: default avatarAlice Boxhall <aboxhall@chromium.org>
Commit-Queue: Alice Boxhall <aboxhall@chromium.org>
Cr-Commit-Position: refs/heads/master@{#789893}
parent ec0c041a
......@@ -375,16 +375,16 @@ void LocationBarView::SelectAll() {
void LocationBarView::FocusLocation(bool is_user_initiated) {
const bool omnibox_already_focused = omnibox_view_->HasFocus();
if (is_user_initiated)
omnibox_view()->model()->Unelide();
omnibox_view_->SetFocus(is_user_initiated);
if (omnibox_already_focused)
omnibox_view()->model()->ClearKeyword();
if (is_user_initiated)
omnibox_view_->SelectAll(true);
if (!is_user_initiated)
return;
omnibox_view_->SelectAll(true);
omnibox_view()->model()->Unelide();
}
void LocationBarView::Revert() {
......
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