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

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

Issue 71683003: Have AutofillManagerDelegate supply the AutofillWebDataService to core code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Response to review 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 9926016bdaaf003b057c3bdc18b91f4778671264..38da166d4d66efac68976be868f74fc45d2ae92f 100644
--- a/components/autofill/core/browser/personal_data_manager.h
+++ b/components/autofill/core/browser/personal_data_manager.h
@@ -13,22 +13,19 @@
#include "base/memory/scoped_vector.h"
#include "base/observer_list.h"
#include "base/strings/string16.h"
+#include "components/autofill/core/browser/autofill_metrics.h"
#include "components/autofill/core/browser/autofill_profile.h"
#include "components/autofill/core/browser/credit_card.h"
#include "components/autofill/core/browser/field_types.h"
+#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#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 {
-class BrowserContext;
-}
-
namespace autofill {
class AutofillInteractiveTest;
-class AutofillMetrics;
class AutofillTest;
class FormStructure;
class PersonalDataManagerObserver;
@@ -55,11 +52,11 @@ class PersonalDataManager : public WebDataServiceConsumer,
explicit PersonalDataManager(const std::string& app_locale);
virtual ~PersonalDataManager();
- // Kicks off asynchronous loading of profiles and credit cards. |context| and
- // |pref_service| must outlive this instance. |is_off_the_record| informs
+ // Kicks off asynchronous loading of profiles and credit cards.
+ // |pref_service| must outlive this instance. |is_off_the_record| informs
// this instance whether the user is currently operating in an off-the-record
// context.
- void Init(content::BrowserContext* context,
+ void Init(scoped_refptr<AutofillWebDataService> database,
PrefService* pref_service,
bool is_off_the_record);
@@ -259,13 +256,22 @@ class PersonalDataManager : public WebDataServiceConsumer,
virtual bool IsAutofillEnabled() const;
// For tests.
- 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);
+ const AutofillMetrics* metric_logger() const { return metric_logger_.get(); }
+
+ void set_database(scoped_refptr<AutofillWebDataService> database) {
+ database_ = database;
+ }
+
+ void set_metric_logger(const AutofillMetrics* metric_logger) {
+ metric_logger_.reset(metric_logger);
+ }
+
+ void set_pref_service(PrefService* pref_service) {
+ pref_service_ = pref_service;
+ }
- // The browser context this PersonalDataManager is in.
- content::BrowserContext* browser_context_;
+ // The backing database that this PersonalDataManager uses.
+ scoped_refptr<AutofillWebDataService> database_;
// True if personal data has been loaded from the web database.
bool is_data_loaded_;

Powered by Google App Engine
This is Rietveld 408576698