Commit ab5c5f99 authored by Evan Stade's avatar Evan Stade Committed by Commit Bot

WebLayer: fix crash in weblayer shell

When the favicon is updated but the top contents container is not set as
the top view, finding the favicon view would fail.

test:
1. click top left dropdown menu
2. select alternate top view
3. navigate

Bug: 1145310
Change-Id: I7aadc6a8b43b18e318d2ffea89aea0688a27e636
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2519090
Auto-Submit: Evan Stade <estade@chromium.org>
Commit-Queue: Scott Violet <sky@chromium.org>
Reviewed-by: default avatarScott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824016}
parent 21735e20
...@@ -769,7 +769,7 @@ public class WebLayerShellActivity extends AppCompatActivity { ...@@ -769,7 +769,7 @@ public class WebLayerShellActivity extends AppCompatActivity {
private void updateFavicon(@NonNull Tab tab) { private void updateFavicon(@NonNull Tab tab) {
if (tab == mBrowser.getActiveTab()) { if (tab == mBrowser.getActiveTab()) {
assert mTabToPerTabState.containsKey(tab); assert mTabToPerTabState.containsKey(tab);
((ImageView) findViewById(R.id.favicon_image_view)) ((ImageView) mTopContentsContainer.findViewById(R.id.favicon_image_view))
.setImageBitmap(mTabToPerTabState.get(tab) .setImageBitmap(mTabToPerTabState.get(tab)
.mFaviconFetcher.getFaviconForCurrentNavigation()); .mFaviconFetcher.getFaviconForCurrentNavigation());
} }
......
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