Chromium Code Reviews| Index: chrome/browser/autofill/autofill_download.cc |
| diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc |
| index 66a63f22b050d5da38856891089f5d5bac6aa0c7..5729f18b10bf5827c2b5f35676545b9179161c0d 100644 |
| --- a/chrome/browser/autofill/autofill_download.cc |
| +++ b/chrome/browser/autofill/autofill_download.cc |
| @@ -12,6 +12,7 @@ |
| #include "base/rand_util.h" |
| #include "base/stl_util.h" |
| #include "base/string_util.h" |
| +#include "chrome/browser/autofill/autofill_download_url.h" |
| #include "chrome/browser/autofill/autofill_metrics.h" |
| #include "chrome/browser/autofill/autofill_xml_parser.h" |
| #include "chrome/browser/autofill/form_structure.h" |
| @@ -27,18 +28,8 @@ |
| using content::BrowserContext; |
| namespace { |
| -const char kAutofillQueryServerRequestUrl[] = |
| - "https://clients1.google.com/tbproxy/af/query?client="; |
| -const char kAutofillUploadServerRequestUrl[] = |
| - "https://clients1.google.com/tbproxy/af/upload?client="; |
| const char kAutofillQueryServerNameStartInHeader[] = "GFE/"; |
| -#if defined(GOOGLE_CHROME_BUILD) |
| -const char kClientName[] = "Google Chrome"; |
| -#else |
| -const char kClientName[] = "Chromium"; |
| -#endif // defined(GOOGLE_CHROME_BUILD) |
| - |
| const size_t kMaxFormCacheSize = 16; |
| }; |
| @@ -60,6 +51,7 @@ AutofillDownloadManager::AutofillDownloadManager(BrowserContext* context, |
| DCHECK(observer_); |
| PrefServiceBase* preferences = |
| PrefServiceBase::FromBrowserContext(browser_context_); |
| + autofill_download_url_.reset(new AutofillDownloadUrl(preferences)); |
|
Albert Bodenhamer
2012/10/24 19:51:56
I still think it would be a bit better to just all
ahutter
2012/10/24 21:29:45
Done.
|
| positive_upload_rate_ = |
| preferences->GetDouble(prefs::kAutofillPositiveUploadRate); |
| negative_upload_rate_ = |
| @@ -168,17 +160,16 @@ bool AutofillDownloadManager::StartRequest( |
| net::URLRequestContextGetter* request_context = |
| browser_context_->GetRequestContext(); |
| DCHECK(request_context); |
| - std::string request_url; |
| + GURL request_url; |
| if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY) |
| - request_url = kAutofillQueryServerRequestUrl; |
| + request_url = autofill_download_url_.get()->GetAutofillRequestUrl(); |
| else |
| - request_url = kAutofillUploadServerRequestUrl; |
| - request_url += kClientName; |
| + request_url = autofill_download_url_.get()->GetAutofillUploadUrl(); |
| // Id is ignored for regular chrome, in unit test id's for fake fetcher |
| // factory will be 0, 1, 2, ... |
| net::URLFetcher* fetcher = net::URLFetcher::Create( |
| - fetcher_id_for_unittest_++, GURL(request_url), net::URLFetcher::POST, |
| + fetcher_id_for_unittest_++, request_url, net::URLFetcher::POST, |
| this); |
| url_fetchers_[fetcher] = request_data; |
| fetcher->SetAutomaticallyRetryOn5xx(false); |