Chromium Code Reviews| Index: chrome/browser/autofill/autocheckout/whitelist_url.cc |
| diff --git a/chrome/browser/autofill/autocheckout/whitelist_url.cc b/chrome/browser/autofill/autocheckout/whitelist_url.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..41153e46d1c89dcd4c96e58d45232a664bf95ffe |
| --- /dev/null |
| +++ b/chrome/browser/autofill/autocheckout/whitelist_url.cc |
| @@ -0,0 +1,33 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/autofill/autocheckout/whitelist_url.h" |
| + |
| +#include <string> |
| + |
| +#include "base/command_line.h" |
| +#include "chrome/common/chrome_switches.h" |
| +#include "googleurl/src/gurl.h" |
| + |
| +namespace { |
| + |
| +const char kDefaultAutocheckoutWhitelistUrl[] = |
| + "http://www.gstatic.com/commerce/autocheckout/whitelist.csv"; |
| + |
| +} // anonymous namespace |
|
ahutter
2013/01/19 02:07:16
just "namespace"
benquan
2013/01/23 23:50:53
Done.
|
| + |
| +namespace autocheckout { |
| + |
| +GURL GetAutocheckoutWhitelistUrl() { |
| + const CommandLine& command_line = *CommandLine::ForCurrentProcess(); |
| + std::string autocheckoutWhitelistUrl = command_line.GetSwitchValueASCII( |
| + switches::kAutocheckoutWhitelistUrl); |
| + if (autocheckoutWhitelistUrl.empty()) |
| + return GURL(kDefaultAutocheckoutWhitelistUrl); |
| + |
| + return GURL(autocheckoutWhitelistUrl); |
| +} |
| + |
| +} // namespace autocheckout |
| + |