Commit 63e9df80 authored by Mia Glaese's avatar Mia Glaese Committed by Commit Bot

[Start Surface] Fix crash on selecting suggestion from omnibox.

Setting IS_SHOWING_OVERVIEW to false triggers the TasksSurfaceViewBinder to set visibility to GONE.
Setting the TasksSurface visibility to GONE shifts focus to its parent view.
This implicitly unfocuses the LocationBar, which triggers the UrlFocusChangeListeners.
The StartSurface UrlFocusChangeListener calls StartSurface.notifyStateChange().
Here we crash on "assert mPropertyModel.get(IS_SHOWING_OVERVIEW)", since it's already set to false.
Swapping the two lines resolves the issue.

Bug: 982018

Change-Id: I84f8634871c6990ec6440684a7fe53498c38fe14
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1911102
Commit-Queue: Mia Glaese <glamia@chromium.org>
Reviewed-by: default avatarGanggui Tang <gogerald@chromium.org>
Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#714766}
parent c4c75b9a
...@@ -344,8 +344,9 @@ class StartSurfaceMediator ...@@ -344,8 +344,9 @@ class StartSurfaceMediator
@Override @Override
public void startedHiding() { public void startedHiding() {
if (mPropertyModel != null) { if (mPropertyModel != null) {
mPropertyModel.set(IS_SHOWING_OVERVIEW, false);
mFakeboxDelegate.removeUrlFocusChangeListener(mUrlFocusChangeListener); mFakeboxDelegate.removeUrlFocusChangeListener(mUrlFocusChangeListener);
mPropertyModel.set(IS_SHOWING_OVERVIEW, false);
destroyFeedSurfaceCoordinator(); destroyFeedSurfaceCoordinator();
} }
for (StartSurface.OverviewModeObserver observer : mObservers) { for (StartSurface.OverviewModeObserver observer : mObservers) {
......
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