Commit accd9496 authored by beaudoin's avatar beaudoin Committed by Commit bot

[Icons NTP] Use GetVariationParamValue instead of experiment prefix to...

[Icons NTP] Use GetVariationParamValue instead of experiment prefix to determine when large icons are enabled.

This is the standard pattern for adding a forcing flags in about://flags.

This also matches a google3 change that just landed which declares that parameter.

BUG=467712

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

Cr-Commit-Position: refs/heads/master@{#322456}
parent ae8db840
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
#include "chrome/browser/favicon/favicon_tab_helper.h" #include "chrome/browser/favicon/favicon_tab_helper.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "chrome/browser/chrome_notification_types.h" #include "chrome/browser/chrome_notification_types.h"
#include "chrome/browser/favicon/chrome_favicon_client.h" #include "chrome/browser/favicon/chrome_favicon_client.h"
...@@ -21,6 +20,7 @@ ...@@ -21,6 +20,7 @@
#include "components/favicon/core/favicon_tab_helper_observer.h" #include "components/favicon/core/favicon_tab_helper_observer.h"
#include "components/favicon_base/favicon_types.h" #include "components/favicon_base/favicon_types.h"
#include "components/history/core/browser/history_service.h" #include "components/history/core/browser/history_service.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/browser/favicon_status.h" #include "content/public/browser/favicon_status.h"
#include "content/public/browser/invalidate_type.h" #include "content/public/browser/invalidate_type.h"
#include "content/public/browser/navigation_controller.h" #include "content/public/browser/navigation_controller.h"
...@@ -47,8 +47,7 @@ namespace { ...@@ -47,8 +47,7 @@ namespace {
// Returns whether icon NTP is enabled. // Returns whether icon NTP is enabled.
bool IsIconNTPEnabled() { bool IsIconNTPEnabled() {
return StartsWithASCII(base::FieldTrialList::FindFullName("IconNTP"), return variations::GetVariationParamValue("IconNTP", "state") == "enabled";
"Enabled", true);
} }
} // namespace } // namespace
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
#include "chrome/grit/generated_resources.h" #include "chrome/grit/generated_resources.h"
#include "components/search_engines/template_url_prepopulate_data.h" #include "components/search_engines/template_url_prepopulate_data.h"
#include "components/search_engines/template_url_service.h" #include "components/search_engines/template_url_service.h"
#include "components/variations/variations_associated_data.h"
#include "grit/browser_resources.h" #include "grit/browser_resources.h"
#include "grit/theme_resources.h" #include "grit/theme_resources.h"
#include "net/url_request/url_request.h" #include "net/url_request/url_request.h"
...@@ -81,8 +82,7 @@ bool DefaultSearchProviderIsGoogle(Profile* profile) { ...@@ -81,8 +82,7 @@ bool DefaultSearchProviderIsGoogle(Profile* profile) {
// Returns whether icon NTP is enabled. // Returns whether icon NTP is enabled.
bool IsIconNTPEnabled() { bool IsIconNTPEnabled() {
return StartsWithASCII(base::FieldTrialList::FindFullName("IconNTP"), return variations::GetVariationParamValue("IconNTP", "state") == "enabled";
"Enabled", true);
} }
// Returns whether we are in the Fast NTP experiment or not. // Returns whether we are in the Fast NTP experiment or not.
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include "base/i18n/rtl.h" #include "base/i18n/rtl.h"
#include "base/json/string_escape.h" #include "base/json/string_escape.h"
#include "base/metrics/field_trial.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/stringprintf.h" #include "base/strings/stringprintf.h"
...@@ -17,6 +16,7 @@ ...@@ -17,6 +16,7 @@
#include "chrome/grit/renderer_resources.h" #include "chrome/grit/renderer_resources.h"
#include "chrome/renderer/searchbox/searchbox.h" #include "chrome/renderer/searchbox/searchbox.h"
#include "components/crx_file/id_util.h" #include "components/crx_file/id_util.h"
#include "components/variations/variations_associated_data.h"
#include "content/public/renderer/render_view.h" #include "content/public/renderer/render_view.h"
#include "third_party/WebKit/public/platform/WebURLRequest.h" #include "third_party/WebKit/public/platform/WebURLRequest.h"
#include "third_party/WebKit/public/web/WebDocument.h" #include "third_party/WebKit/public/web/WebDocument.h"
...@@ -64,8 +64,7 @@ base::string16 V8ValueToUTF16(v8::Handle<v8::Value> v) { ...@@ -64,8 +64,7 @@ base::string16 V8ValueToUTF16(v8::Handle<v8::Value> v) {
// Returns whether we should use large icons on NTP. // Returns whether we should use large icons on NTP.
bool IsIconNTPEnabled() { bool IsIconNTPEnabled() {
return StartsWithASCII(base::FieldTrialList::FindFullName("IconNTP"), return variations::GetVariationParamValue("IconNTP", "state") == "enabled";
"Enabled", true);
} }
// Converts string16 to V8 String. // Converts string16 to V8 String.
......
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