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

Unified Diff: components/autofill/core/browser/personal_data_manager.h

Issue 52713006: Parameterize the PrefService that PersonalDataManager uses. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Response to review, fix unit tests Created 7 years, 1 month 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: components/autofill/core/browser/personal_data_manager.h
diff --git a/components/autofill/core/browser/personal_data_manager.h b/components/autofill/core/browser/personal_data_manager.h
index 40d5159135bd7f29979c50b44e798ad4a9a99f49..62e3bfc13c2184dd549f0df4757f7e33e7836ed4 100644
--- a/components/autofill/core/browser/personal_data_manager.h
+++ b/components/autofill/core/browser/personal_data_manager.h
@@ -19,6 +19,7 @@
#include "components/autofill/core/browser/webdata/autofill_webdata_service_observer.h"
#include "components/webdata/common/web_data_service_consumer.h"
+class PrefService;
class RemoveAutofillTester;
namespace content {
@@ -54,8 +55,9 @@ class PersonalDataManager : public WebDataServiceConsumer,
explicit PersonalDataManager(const std::string& app_locale);
virtual ~PersonalDataManager();
- // Kicks off asynchronous loading of profiles and credit cards.
- void Init(content::BrowserContext* context);
+ // Kicks off asynchronous loading of profiles and credit cards. |context| and
+ // |pref_service| must outlive this instance.
+ void Init(content::BrowserContext* context, PrefService* pref_service);
// WebDataServiceConsumer:
virtual void OnWebDataServiceRequestDone(
@@ -256,6 +258,7 @@ class PersonalDataManager : public WebDataServiceConsumer,
const AutofillMetrics* metric_logger() const;
void set_metric_logger(const AutofillMetrics* metric_logger);
void set_browser_context(content::BrowserContext* context);
+ void set_pref_service(PrefService* pref_service);
// The browser context this PersonalDataManager is in.
content::BrowserContext* browser_context_;
@@ -299,6 +302,9 @@ class PersonalDataManager : public WebDataServiceConsumer,
// For logging UMA metrics. Overridden by metrics tests.
scoped_ptr<const AutofillMetrics> metric_logger_;
+ // The PrefService that this instance uses. Must outlive this instance.
+ PrefService* pref_service_;
+
// Whether we have already logged the number of profiles this session.
mutable bool has_logged_profile_count_;

Powered by Google App Engine
This is Rietveld 408576698