Commit 5e81eb6e authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Update IPHBubbleDelegateImpl to use incognito profile when called

incognito.

This CL update the profile passing to TrackerFactory and
DownloadManagerService from IPHBubbleDelegateImpl. Currently, it is
always regular profile, however it is not safe because of possible data
leakage from incognito to regular profile.

Therefore, this CL uses the profile (i.e., regular or off-the-record
profile) belong to active tab in IPHBubbleDelegateImpl,then passes it to
TrackerFactory and DownloadManagerService.

Bug: 1041781

Change-Id: I6b6d18e50f8e59068db4f59ca2bc75e25883d99a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2066930
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#745412}
parent d8d1b11d
......@@ -16,8 +16,8 @@ import org.chromium.chrome.browser.feature_engagement.TrackerFactory;
import org.chromium.chrome.browser.infobar.IPHInfoBarSupport.PopupState;
import org.chromium.chrome.browser.infobar.IPHInfoBarSupport.TrackerParameters;
import org.chromium.chrome.browser.permissions.PermissionSettingsBridge;
import org.chromium.chrome.browser.profiles.Profile;
import org.chromium.chrome.browser.tab.Tab;
import org.chromium.chrome.browser.tab.TabImpl;
import org.chromium.chrome.browser.util.AccessibilityUtil;
import org.chromium.components.browser_ui.widget.textbubble.TextBubble;
import org.chromium.components.feature_engagement.FeatureConstants;
......@@ -35,8 +35,7 @@ class IPHBubbleDelegateImpl implements IPHInfoBarSupport.IPHBubbleDelegate {
IPHBubbleDelegateImpl(Context context, Tab tab) {
mContext = context;
Profile profile = Profile.getLastUsedProfile();
mTracker = TrackerFactory.getTrackerForProfile(profile);
mTracker = TrackerFactory.getTrackerForProfile(((TabImpl) tab).getProfile());
mTab = tab;
}
......@@ -65,8 +64,8 @@ class IPHBubbleDelegateImpl implements IPHInfoBarSupport.IPHBubbleDelegate {
switch (infoBarId) {
case InfoBarIdentifier.DOWNLOAD_PROGRESS_INFOBAR_ANDROID:
DownloadInfoBarController controller =
DownloadManagerService.getDownloadManagerService()
.getInfoBarController(Profile.getLastUsedProfile().isOffTheRecord());
DownloadManagerService.getDownloadManagerService().getInfoBarController(
mTab.isIncognito());
return controller != null ? controller.getTrackerParameters() : null;
case InfoBarIdentifier.GROUPED_PERMISSION_INFOBAR_DELEGATE_ANDROID:
if (PermissionSettingsBridge.shouldShowNotificationsPromo(mTab.getWebContents())) {
......
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