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

Unified Diff: chrome/browser/importer/profile_writer.cc

Issue 480953002: Implement "Autofill form data" import for Firefox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added test case Created 6 years, 4 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/importer/profile_writer.cc
diff --git a/chrome/browser/importer/profile_writer.cc b/chrome/browser/importer/profile_writer.cc
index ab5b4482d5c56d22c0cf2923f77fc3bceab658ad..b0bd173a87ed66f7dd21ec0902a9506594a91ee6 100644
--- a/chrome/browser/importer/profile_writer.cc
+++ b/chrome/browser/importer/profile_writer.cc
@@ -22,9 +22,11 @@
#include "chrome/browser/password_manager/password_store_factory.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/search_engines/template_url_service_factory.h"
+#include "chrome/browser/webdata/web_data_service_factory.h"
#include "chrome/common/importer/imported_bookmark_entry.h"
#include "chrome/common/importer/imported_favicon_usage.h"
#include "chrome/common/pref_names.h"
+#include "components/autofill/core/browser/webdata/autofill_webdata_service.h"
#include "components/bookmarks/browser/bookmark_model.h"
#include "components/password_manager/core/browser/password_store.h"
#include "components/search_engines/template_url.h"
@@ -329,4 +331,13 @@ void ProfileWriter::AddKeywords(ScopedVector<TemplateURL> template_urls,
}
}
+void ProfileWriter::AddAutofillFormDataEntries(
+ const std::vector<autofill::AutofillEntry>& autofill_entries) {
+ scoped_refptr<autofill::AutofillWebDataService> web_data_service =
+ WebDataServiceFactory::GetAutofillWebDataForProfile(
+ profile_, Profile::EXPLICIT_ACCESS);
+ if (!autofill_entries.empty() || web_data_service.get())
Ilya Sherman 2014/08/20 05:47:41 Hmm, why is this condition an 'or'? It seems like
Nikhil 2014/08/20 11:29:16 It should have been an 'and'. Thanks for catching
+ web_data_service->UpdateAutofillEntries(autofill_entries);
+}
+
ProfileWriter::~ProfileWriter() {}

Powered by Google App Engine
This is Rietveld 408576698