Index: components/autofill/core/browser/autofill_download.cc |
diff --git a/components/autofill/core/browser/autofill_download.cc b/components/autofill/core/browser/autofill_download.cc |
index 9bf81e2c72bbcb71c64492e642ff9cee3f67eb06..994db7161eac34ae63ffd210af2208777b1080a0 100644 |
--- a/components/autofill/core/browser/autofill_download.cc |
+++ b/components/autofill/core/browser/autofill_download.cc |
@@ -18,7 +18,6 @@ |
#include "components/autofill/core/browser/autofill_xml_parser.h" |
#include "components/autofill/core/browser/form_structure.h" |
#include "components/autofill/core/common/autofill_pref_names.h" |
-#include "components/user_prefs/user_prefs.h" |
#include "content/public/browser/browser_context.h" |
#include "net/base/load_flags.h" |
#include "net/http/http_response_headers.h" |
@@ -70,8 +69,10 @@ struct AutofillDownloadManager::FormRequestData { |
}; |
AutofillDownloadManager::AutofillDownloadManager(BrowserContext* context, |
+ PrefService* pref_service, |
Observer* observer) |
: browser_context_(context), |
+ pref_service_(pref_service), |
observer_(observer), |
max_form_cache_size_(kMaxFormCacheSize), |
next_query_request_(base::Time::Now()), |
@@ -80,11 +81,10 @@ AutofillDownloadManager::AutofillDownloadManager(BrowserContext* context, |
negative_upload_rate_(0), |
fetcher_id_for_unittest_(0) { |
DCHECK(observer_); |
- PrefService* preferences = user_prefs::UserPrefs::Get(browser_context_); |
positive_upload_rate_ = |
- preferences->GetDouble(prefs::kAutofillPositiveUploadRate); |
+ pref_service_->GetDouble(prefs::kAutofillPositiveUploadRate); |
negative_upload_rate_ = |
- preferences->GetDouble(prefs::kAutofillNegativeUploadRate); |
+ pref_service_->GetDouble(prefs::kAutofillNegativeUploadRate); |
} |
AutofillDownloadManager::~AutofillDownloadManager() { |
@@ -170,8 +170,7 @@ void AutofillDownloadManager::SetPositiveUploadRate(double rate) { |
positive_upload_rate_ = rate; |
DCHECK_GE(rate, 0.0); |
DCHECK_LE(rate, 1.0); |
- PrefService* preferences = user_prefs::UserPrefs::Get(browser_context_); |
- preferences->SetDouble(prefs::kAutofillPositiveUploadRate, rate); |
+ pref_service_->SetDouble(prefs::kAutofillPositiveUploadRate, rate); |
} |
void AutofillDownloadManager::SetNegativeUploadRate(double rate) { |
@@ -180,8 +179,7 @@ void AutofillDownloadManager::SetNegativeUploadRate(double rate) { |
negative_upload_rate_ = rate; |
DCHECK_GE(rate, 0.0); |
DCHECK_LE(rate, 1.0); |
- PrefService* preferences = user_prefs::UserPrefs::Get(browser_context_); |
- preferences->SetDouble(prefs::kAutofillNegativeUploadRate, rate); |
+ pref_service_->SetDouble(prefs::kAutofillNegativeUploadRate, rate); |
} |
bool AutofillDownloadManager::StartRequest( |