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

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

Issue 12340111: Introduce //components/user_prefs, use to eliminate c/b/prefs dependency in Autofill. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Pure merge of LKGR Created 7 years, 10 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 ebb0074e5985e5c9a963bf7573d330c11dcd2b40..394ca7fc9a61d8f0c2b59134c097f42fec74200c 100644
--- a/chrome/browser/autofill/autofill_download.cc
+++ b/chrome/browser/autofill/autofill_download.cc
@@ -18,6 +18,7 @@
#include "chrome/browser/autofill/autofill_xml_parser.h"
#include "chrome/browser/autofill/form_structure.h"
#include "chrome/common/pref_names.h"
+#include "components/user_prefs/user_prefs.h"
#include "content/public/browser/browser_context.h"
#include "googleurl/src/gurl.h"
#include "net/base/load_flags.h"
@@ -70,8 +71,7 @@ AutofillDownloadManager::AutofillDownloadManager(BrowserContext* context,
negative_upload_rate_(0),
fetcher_id_for_unittest_(0) {
DCHECK(observer_);
- PrefService* preferences =
- PrefServiceFromBrowserContext(browser_context_);
+ PrefService* preferences = components::UserPrefs::Get(browser_context_);
positive_upload_rate_ =
preferences->GetDouble(prefs::kAutofillPositiveUploadRate);
negative_upload_rate_ =
@@ -160,8 +160,7 @@ void AutofillDownloadManager::SetPositiveUploadRate(double rate) {
positive_upload_rate_ = rate;
DCHECK_GE(rate, 0.0);
DCHECK_LE(rate, 1.0);
- PrefService* preferences = PrefServiceFromBrowserContext(
- browser_context_);
+ PrefService* preferences = components::UserPrefs::Get(browser_context_);
preferences->SetDouble(prefs::kAutofillPositiveUploadRate, rate);
}
@@ -171,8 +170,7 @@ void AutofillDownloadManager::SetNegativeUploadRate(double rate) {
negative_upload_rate_ = rate;
DCHECK_GE(rate, 0.0);
DCHECK_LE(rate, 1.0);
- PrefService* preferences = PrefServiceFromBrowserContext(
- browser_context_);
+ PrefService* preferences = components::UserPrefs::Get(browser_context_);
preferences->SetDouble(prefs::kAutofillNegativeUploadRate, rate);
}

Powered by Google App Engine
This is Rietveld 408576698