diff options
Diffstat (limited to 'components/autofill')
-rw-r--r-- | components/autofill/browser/autocheckout/whitelist_manager.cc | 12 | ||||
-rw-r--r-- | components/autofill/common/autofill_switches.cc | 3 | ||||
-rw-r--r-- | components/autofill/common/autofill_switches.h | 1 |
3 files changed, 14 insertions, 2 deletions
diff --git a/components/autofill/browser/autocheckout/whitelist_manager.cc b/components/autofill/browser/autocheckout/whitelist_manager.cc index 53806c7..60ab2db 100644 --- a/components/autofill/browser/autocheckout/whitelist_manager.cc +++ b/components/autofill/browser/autocheckout/whitelist_manager.cc @@ -27,11 +27,19 @@ const int kDownloadIntervalSeconds = 86400; // 1 day // to reduce contention at startup time. const int kInitialDownloadDelaySeconds = 3; -const char kWhitelistUrl[] = +const char kDefaultWhitelistUrl[] = "https://www.gstatic.com/commerce/autocheckout/whitelist.csv"; const char kWhiteListKeyName[] = "autocheckout_whitelist_manager"; +std::string GetWhitelistUrl() { + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); + std::string whitelist_url = command_line.GetSwitchValueASCII( + autofill::switches::kAutocheckoutWhitelistUrl); + + return whitelist_url.empty() ? kDefaultWhitelistUrl : whitelist_url; +} + } // namespace @@ -86,7 +94,7 @@ void WhitelistManager::TriggerDownload() { request_started_timestamp_ = base::Time::Now(); request_.reset(net::URLFetcher::Create( - 0, GURL(kWhitelistUrl), net::URLFetcher::GET, this)); + 0, GURL(GetWhitelistUrl()), net::URLFetcher::GET, this)); request_->SetRequestContext(context_getter_); request_->SetAutomaticallyRetryOn5xx(false); request_->SetLoadFlags(net::LOAD_DO_NOT_SAVE_COOKIES | diff --git a/components/autofill/common/autofill_switches.cc b/components/autofill/common/autofill_switches.cc index 3e6b388..defb318 100644 --- a/components/autofill/common/autofill_switches.cc +++ b/components/autofill/common/autofill_switches.cc @@ -7,6 +7,9 @@ namespace autofill { namespace switches { +// Flag used to tell Chrome the Autochecout whitelist url. +const char kAutocheckoutWhitelistUrl[] = "autocheckout-whitelist-url"; + // Flag used to tell Chrome the base url of the Autofill service. const char kAutofillServiceUrl[] = "autofill-service-url"; diff --git a/components/autofill/common/autofill_switches.h b/components/autofill/common/autofill_switches.h index 536e4d9..5bf022f 100644 --- a/components/autofill/common/autofill_switches.h +++ b/components/autofill/common/autofill_switches.h @@ -10,6 +10,7 @@ namespace switches { // All switches in alphabetical order. The switches should be documented // alongside the definition of their values in the .cc file. +extern const char kAutocheckoutWhitelistUrl[]; extern const char kAutofillServiceUrl[]; extern const char kBypassAutocheckoutWhitelist[]; extern const char kDisableInteractiveAutocomplete[]; |