Commit 82119cae authored by Theresa Wellington's avatar Theresa Wellington Committed by Commit Bot

[Home] Disable personalized zero-suggest if search promo has been shown

BUG=781994

Change-Id: I45f50f44ccb7ac510255f8659d77713f95962b86
Reviewed-on: https://chromium-review.googlesource.com/777941
Commit-Queue: Theresa <twellington@chromium.org>
Reviewed-by: default avatarTed Choc <tedchoc@chromium.org>
Cr-Commit-Position: refs/heads/master@{#517844}
parent 082bcd2a
......@@ -29,6 +29,7 @@ import org.chromium.base.metrics.RecordHistogram;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.ChromeSwitches;
import org.chromium.chrome.browser.firstrun.FirstRunUtils;
import org.chromium.chrome.browser.locale.LocaleManager;
import org.chromium.chrome.browser.metrics.UmaSessionStats;
import org.chromium.chrome.browser.omnibox.OmniboxPlaceholderFieldTrial;
import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
......@@ -279,10 +280,7 @@ public class FeatureUtilities {
manager.setChromeHomeEnabled(isChromeHomeEnabled);
PrefServiceBridge.getInstance().setChromeHomePersonalizedOmniboxSuggestionsEnabled(
!isChromeHomeEnabled()
? false
: ChromeFeatureList.isEnabled(
ChromeFeatureList.CHROME_HOME_PERSONALIZED_OMNIBOX_SUGGESTIONS));
areChromeHomePersonalizedOmniboxSuggestionsEnabled());
if (!ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_HOME_PROMO)
&& manager.isChromeHomeUserPreferenceSet()) {
......@@ -298,6 +296,14 @@ public class FeatureUtilities {
isChromeHomeEnabled() ? ENABLED_EXPERIMENT_GROUP : DISABLED_EXPERIMENT_GROUP);
}
private static boolean areChromeHomePersonalizedOmniboxSuggestionsEnabled() {
LocaleManager localeManager = LocaleManager.getInstance();
return isChromeHomeEnabled() && !localeManager.hasCompletedSearchEnginePromo()
&& !localeManager.hasShownSearchEnginePromoThisSession()
&& ChromeFeatureList.isEnabled(
ChromeFeatureList.CHROME_HOME_PERSONALIZED_OMNIBOX_SUGGESTIONS);
}
/**
* Update the user's setting for Chrome Home. This is a user-facing setting different from the
* one in chrome://flags. This setting will take prescience over the one in flags.
......
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