diff options
author | benquan@chromium.org <benquan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:45:04 +0000 |
---|---|---|
committer | benquan@chromium.org <benquan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-08 05:45:04 +0000 |
commit | 46917c6e17331bae0b13510974484180ee1365ea (patch) | |
tree | 921c4d8064f9d79602e6f94ce5cfd23abf146a6d /components | |
parent | 3dab03f3e49bbdb72812fd76eb4a39bc91a3147f (diff) | |
download | chromium_src-46917c6e17331bae0b13510974484180ee1365ea.zip chromium_src-46917c6e17331bae0b13510974484180ee1365ea.tar.gz chromium_src-46917c6e17331bae0b13510974484180ee1365ea.tar.bz2 |
add switches::kAutocheckoutWhitelistUrl
BUG=
Review URL: https://chromiumcodereview.appspot.com/16160021
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@205040 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components')
-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[]; |