Commit c09e0886 authored by huangs's avatar huangs Committed by Commit bot

[Icons NTP] Add window.configData.useIcons.

This propagates the presence of IconNTP/Enabled to the local NTP, so we
keep display old design and conditionally render (upcoming) new design.

BUG=467712

Review URL: https://codereview.chromium.org/1020853012

Cr-Commit-Position: refs/heads/master@{#322161}
parent 80228526
...@@ -79,6 +79,12 @@ bool DefaultSearchProviderIsGoogle(Profile* profile) { ...@@ -79,6 +79,12 @@ bool DefaultSearchProviderIsGoogle(Profile* profile) {
SEARCH_ENGINE_GOOGLE); SEARCH_ENGINE_GOOGLE);
} }
// Returns whether icon NTP is enabled.
bool IsIconNTPEnabled() {
return StartsWithASCII(base::FieldTrialList::FindFullName("IconNTP"),
"Enabled", true);
}
// Returns whether we are in the Fast NTP experiment or not. // Returns whether we are in the Fast NTP experiment or not.
bool IsLocalNTPFastEnabled() { bool IsLocalNTPFastEnabled() {
return StartsWithASCII(base::FieldTrialList::FindFullName("LocalNTPFast"), return StartsWithASCII(base::FieldTrialList::FindFullName("LocalNTPFast"),
...@@ -140,6 +146,7 @@ std::string GetConfigData(Profile* profile) { ...@@ -140,6 +146,7 @@ std::string GetConfigData(Profile* profile) {
config_data.Set("translatedStrings", config_data.Set("translatedStrings",
GetTranslatedStrings(is_google).release()); GetTranslatedStrings(is_google).release());
config_data.SetBoolean("isGooglePage", is_google); config_data.SetBoolean("isGooglePage", is_google);
config_data.SetBoolean("useIcons", IsIconNTPEnabled());
// Serialize the dictionary. // Serialize the dictionary.
std::string js_text; std::string js_text;
......
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