Commit 7e469cba authored by megjablon's avatar megjablon Committed by Commit Bot

Don't show the Data Saver promo in incognito mode

BUG=737926

Review-Url: https://codereview.chromium.org/2969843004
Cr-Commit-Position: refs/heads/master@{#485456}
parent b76265c2
......@@ -492,8 +492,10 @@ public class ChromeTabbedActivity
&& preferenceManager.getPromosSkippedOnFirstStart()) {
// Data reduction promo should be temporarily suppressed if the sign in promo is
// shown to avoid nagging users too much.
TabModel currentModel = mTabModelSelectorImpl.getCurrentModel();
if (!SigninPromoUtil.launchSigninPromoIfNeeded(this)) {
if (!DataReductionPromoScreen.launchDataReductionPromo(this)
if (!DataReductionPromoScreen.launchDataReductionPromo(
this, currentModel.isIncognito())
&& getBottomSheet() != null) {
getBottomSheet().showHelpBubbleIfNecessary();
}
......
......@@ -24,10 +24,11 @@ public class DataReductionPromoScreen extends PromoDialog {
* Launch the data reduction promo, if it needs to be displayed.
* @return Whether the data reduction promo was displayed.
*/
public static boolean launchDataReductionPromo(Activity parentActivity) {
public static boolean launchDataReductionPromo(Activity parentActivity, boolean isIncognito) {
// The promo is displayed if Chrome is launched directly (i.e., not with the intent to
// navigate to and view a URL on startup), the instance is part of the field trial,
// and the promo has not been displayed before.
if (isIncognito) return false;
if (!DataReductionPromoUtils.canShowPromos()) return false;
if (DataReductionPromoUtils.getDisplayedFreOrSecondRunPromo()) return false;
// Showing the promo dialog in multiwindow mode is broken on Galaxy Note devices:
......
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