Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1286)

Unified Diff: chrome/browser/autofill/autofill_download.cc

Issue 11230060: Adding commandline switch and user pref for autofill server url. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changing include after rebasing Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/autofill/autofill_download.cc
diff --git a/chrome/browser/autofill/autofill_download.cc b/chrome/browser/autofill/autofill_download.cc
index 26c0af19f02c9b5e8206dfe1e5365c65a0f3fb0f..60e423b82b791676840bfea0cdbf9f9da652bedc 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -13,6 +13,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;
// Log the contents of the upload request
@@ -179,17 +170,19 @@ bool AutofillDownloadManager::StartRequest(
net::URLRequestContextGetter* request_context =
browser_context_->GetRequestContext();
DCHECK(request_context);
- std::string request_url;
+ GURL request_url;
+ PrefServiceBase* preferences = PrefServiceBase::FromBrowserContext(
+ browser_context_);
+ AutofillDownloadUrl autofill_download_url(preferences);
if (request_data.request_type == AutofillDownloadManager::REQUEST_QUERY)
- request_url = kAutofillQueryServerRequestUrl;
+ request_url = autofill_download_url.GetAutofillRequestUrl();
else
- request_url = kAutofillUploadServerRequestUrl;
- request_url += kClientName;
+ request_url = autofill_download_url.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);
« no previous file with comments | « no previous file | chrome/browser/autofill/autofill_download_url.h » ('j') | chrome/browser/autofill/autofill_download_url.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698