Commit 5859750f authored by Side Yilmaz's avatar Side Yilmaz Committed by Commit Bot

Update ToolbarPhone to use incognito profile when called incognito.

This CL update the profile passing to TrackerFactory from ToolbarPhone.
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 |isIncognito| function at ToolbarLayout class
to get correct profile object(i.e., regular or off-the-record profile).

Bug: 1041781
Change-Id: I12324730ed6183ba7019138e5064b8fd98d1b45e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2074677Reviewed-by: default avatarYusuf Ozuysal <yusufo@chromium.org>
Reviewed-by: default avatarRamin Halavati <rhalavati@chromium.org>
Commit-Queue: Side YILMAZ <sideyilmaz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#744980}
parent 689012dd
...@@ -542,8 +542,11 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O ...@@ -542,8 +542,11 @@ public class ToolbarPhone extends ToolbarLayout implements Invalidator.Client, O
openHomepage(); openHomepage();
if (isNativeLibraryReady() if (isNativeLibraryReady()
&& PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()) { && PartnerBrowserCustomizations.isHomepageProviderAvailableAndEnabled()) {
TrackerFactory.getTrackerForProfile(Profile.getLastUsedProfile()) Profile profile = isIncognito()
.notifyEvent(EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED); ? Profile.getLastUsedRegularProfile().getOffTheRecordProfile()
: Profile.getLastUsedRegularProfile();
TrackerFactory.getTrackerForProfile(profile).notifyEvent(
EventConstants.PARTNER_HOME_PAGE_BUTTON_PRESSED);
} }
} }
} }
......
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