Commit dafe8eec authored by Side Yilmaz's avatar Side Yilmaz Committed by Chromium LUCI CQ

Pass the correct profile to LayerTitleCache.

This CL passes the correct profile in LayerTitleCache by accessing
profile with tab#isIncognito boolean.

Bug: 1048632
Change-Id: I9555f637a890ea5052ac044667d953d221d0f84a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2567226Reviewed-by: default avatarDavid Trainor <dtrainor@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#834634}
parent 48fc2519
...@@ -155,13 +155,13 @@ public class LayerTitleCache implements TitleCache { ...@@ -155,13 +155,13 @@ public class LayerTitleCache implements TitleCache {
private void fetchFaviconForTab(final Tab tab) { private void fetchFaviconForTab(final Tab tab) {
if (mFaviconHelper == null) mFaviconHelper = new FaviconHelper(); if (mFaviconHelper == null) mFaviconHelper = new FaviconHelper();
// Since tab#getProfile() is not available by this time, we will use whatever last used // Since tab#getProfile() is not available by this time, we will use tab#isIncognito boolean
// profile. // to get the correct profile.
// TODO (https://crbug.com/1048632): Use the current profile (i.e., regular profile or Profile profile = !tab.isIncognito()
// incognito profile) instead of always using regular profile. It works correctly now, but ? Profile.getLastUsedRegularProfile()
// it is not safe. : Profile.getLastUsedRegularProfile().getPrimaryOTRProfile();
mFaviconHelper.getLocalFaviconImageForURL(Profile.getLastUsedRegularProfile(), mFaviconHelper.getLocalFaviconImageForURL(
tab.getUrlString(), mFaviconSize, new FaviconImageCallback() { profile, tab.getUrlString(), mFaviconSize, new FaviconImageCallback() {
@Override @Override
public void onFaviconAvailable(Bitmap favicon, String iconUrl) { public void onFaviconAvailable(Bitmap favicon, String iconUrl) {
updateFaviconFromHistory(tab, favicon); updateFaviconFromHistory(tab, favicon);
......
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