0

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: Scott Violet <sky@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824016}
This commit is contained in:
Evan Stade
2020-11-04 16:51:35 +00:00
committed by Commit Bot
parent 21735e20a8
commit ab5c5f99cd

@ -769,7 +769,7 @@ public class WebLayerShellActivity extends AppCompatActivity {
private void updateFavicon(@NonNull Tab tab) {
if (tab == mBrowser.getActiveTab()) {
assert mTabToPerTabState.containsKey(tab);
((ImageView) findViewById(R.id.favicon_image_view))
((ImageView) mTopContentsContainer.findViewById(R.id.favicon_image_view))
.setImageBitmap(mTabToPerTabState.get(tab)
.mFaviconFetcher.getFaviconForCurrentNavigation());
}