Commit 2752e8be authored by Marc Treib's avatar Marc Treib Committed by Commit Bot

SearchProviderLogos: Add about:flags entry for UseDdljsonApi on iOS

This is basically the iOS version of
https://chromium-review.googlesource.com/c/600309.
It'll make manual testing of the feature much easier.

Bug: 690467
Change-Id: I46656106f42821346bb323c655296e63e4ddd2b1
Reviewed-on: https://chromium-review.googlesource.com/602129Reviewed-by: default avatarRohit Rao (ping after 24h) <rohitrao@chromium.org>
Commit-Queue: Marc Treib <treib@chromium.org>
Cr-Commit-Position: refs/heads/master@{#492020}
parent a83d1dd4
......@@ -102,6 +102,7 @@ source_set("browser") {
"//components/proxy_config/ios",
"//components/reading_list/ios",
"//components/search_engines",
"//components/search_provider_logos",
"//components/security_state/core",
"//components/signin/core/browser",
"//components/ssl_config",
......
......@@ -29,6 +29,7 @@
#include "components/flags_ui/flags_ui_switches.h"
#include "components/ntp_tiles/switches.h"
#include "components/payments/core/features.h"
#include "components/search_provider_logos/features.h"
#include "components/security_state/core/switches.h"
#include "components/signin/core/common/signin_switches.h"
#include "components/strings/grit/components_strings.h"
......@@ -66,6 +67,29 @@ const FeatureEntry::Choice kMarkHttpAsChoices[] = {
security_state::switches::kMarkHttpAs,
security_state::switches::kMarkHttpAsDangerous}};
const FeatureEntry::FeatureParam kUseDdljsonApiTest1[] = {
{search_provider_logos::features::kDdljsonOverrideUrlParam,
"https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios1.json"}};
const FeatureEntry::FeatureParam kUseDdljsonApiTest2[] = {
{search_provider_logos::features::kDdljsonOverrideUrlParam,
"https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios2.json"}};
const FeatureEntry::FeatureParam kUseDdljsonApiTest3[] = {
{search_provider_logos::features::kDdljsonOverrideUrlParam,
"https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios3.json"}};
const FeatureEntry::FeatureParam kUseDdljsonApiTest4[] = {
{search_provider_logos::features::kDdljsonOverrideUrlParam,
"https://www.gstatic.com/chrome/ntp/doodle_test/ddljson_ios4.json"}};
const FeatureEntry::FeatureVariation kUseDdljsonApiVariations[] = {
{"(force test doodle 1)", kUseDdljsonApiTest1,
arraysize(kUseDdljsonApiTest1), nullptr},
{"(force test doodle 2)", kUseDdljsonApiTest2,
arraysize(kUseDdljsonApiTest2), nullptr},
{"(force test doodle 3)", kUseDdljsonApiTest3,
arraysize(kUseDdljsonApiTest3), nullptr},
{"(force test doodle 4)", kUseDdljsonApiTest4,
arraysize(kUseDdljsonApiTest4), nullptr}};
// To add a new entry, add to the end of kFeatureEntries. There are four
// distinct types of entries:
// . ENABLE_DISABLE_VALUE: entry is either enabled, disabled, or uses the
......@@ -117,7 +141,13 @@ const flags_ui::FeatureEntry kFeatureEntries[] = {
FEATURE_WITH_PARAMS_VALUE_TYPE(
feature_engagement::kIPHDemoMode,
feature_engagement::kIPHDemoModeChoiceVariations,
"IPH_DemoMode")}};
"IPH_DemoMode")},
{"use-ddljson-api", flag_descriptions::kUseDdljsonApiName,
flag_descriptions::kUseDdljsonApiDescription, flags_ui::kOsIos,
FEATURE_WITH_PARAMS_VALUE_TYPE(
search_provider_logos::features::kUseDdljsonApi,
kUseDdljsonApiVariations,
search_provider_logos::features::kUseDdljsonApi.name)}};
// Add all switches from experimental flags to |command_line|.
void AppendSwitchesFromExperimentalSettings(base::CommandLine* command_line) {
......
......@@ -38,6 +38,10 @@ const char kMarkHttpAsNonSecureWhileIncognito[] =
const char kMarkHttpAsNonSecureWhileIncognitoOrEditing[] =
"Warn on HTTP while in Incognito mode or after editing forms";
const char kUseDdljsonApiName[] = "Use new ddljson API for Doodles";
const char kUseDdljsonApiDescription[] =
"Enables the new ddljson API to fetch Doodles for the NTP.";
const char kWebPaymentsName[] = "Web Payments";
const char kWebPaymentsDescription[] =
......
......@@ -35,6 +35,10 @@ extern const char kPhysicalWeb[];
// Description for the flag to enable Physical Web in the omnibox.
extern const char kPhysicalWebDescription[];
// Title and description for the flag to enable the ddljson Doodle API.
extern const char kUseDdljsonApiName[];
extern const char kUseDdljsonApiDescription[];
// Title and description for the flag to enable Web Payments.
extern const char kWebPaymentsName[];
extern const char kWebPaymentsDescription[];
......
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