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

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

Issue 14575004: Extract BookmarksFileImporter from Firefox2Importer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: test cleanup Created 7 years, 7 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/toolbar_importer.cc
diff --git a/chrome/browser/importer/toolbar_importer.cc b/chrome/browser/importer/toolbar_importer.cc
index adaee0e24a59ea60a690600bcbbffe088fd49f80..b2da5bf6648fcb63f3467a0130dedfb3e51efc3b 100644
--- a/chrome/browser/importer/toolbar_importer.cc
+++ b/chrome/browser/importer/toolbar_importer.cc
@@ -11,6 +11,7 @@
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_split.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/bookmarks/imported_bookmark_entry.h"
#include "chrome/browser/first_run/first_run.h"
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_data_types.h"
@@ -269,7 +270,7 @@ void Toolbar5Importer::GetBookmarksFromServerDataResponse(
XmlReader reader;
if (reader.Load(response) && !cancelled()) {
// Construct Bookmarks
- std::vector<ProfileWriter::BookmarkEntry> bookmarks;
+ std::vector<ImportedBookmarkEntry> bookmarks;
if (ParseBookmarksFromReader(&reader, &bookmarks,
bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_GOOGLE_TOOLBAR)))
AddBookmarksToChrome(bookmarks);
@@ -299,7 +300,7 @@ bool Toolbar5Importer::ParseAuthenticationTokenResponse(
// Parsing
bool Toolbar5Importer::ParseBookmarksFromReader(
XmlReader* reader,
- std::vector<ProfileWriter::BookmarkEntry>* bookmarks,
+ std::vector<ImportedBookmarkEntry>* bookmarks,
const string16& bookmark_group_string) {
DCHECK(reader);
DCHECK(bookmarks);
@@ -320,7 +321,7 @@ bool Toolbar5Importer::ParseBookmarksFromReader(
// Parse each |bookmark| blob
while (LocateNextTagWithStopByName(reader, kBookmarkXmlTag,
kBookmarksXmlTag)) {
- ProfileWriter::BookmarkEntry bookmark_entry;
+ ImportedBookmarkEntry bookmark_entry;
std::vector<BookmarkFolderType> folders;
if (ExtractBookmarkInformation(reader, &bookmark_entry, &folders,
bookmark_group_string)) {
@@ -383,7 +384,7 @@ bool Toolbar5Importer::LocateNextTagWithStopByName(XmlReader* reader,
bool Toolbar5Importer::ExtractBookmarkInformation(
XmlReader* reader,
- ProfileWriter::BookmarkEntry* bookmark_entry,
+ ImportedBookmarkEntry* bookmark_entry,
std::vector<BookmarkFolderType>* bookmark_folders,
const string16& bookmark_group_string) {
DCHECK(reader);
@@ -456,7 +457,7 @@ bool Toolbar5Importer::ExtractNamedValueFromXmlReader(XmlReader* reader,
bool Toolbar5Importer::ExtractTitleFromXmlReader(
XmlReader* reader,
- ProfileWriter::BookmarkEntry* entry) {
+ ImportedBookmarkEntry* entry) {
DCHECK(reader);
DCHECK(entry);
@@ -472,7 +473,7 @@ bool Toolbar5Importer::ExtractTitleFromXmlReader(
bool Toolbar5Importer::ExtractUrlFromXmlReader(
XmlReader* reader,
- ProfileWriter::BookmarkEntry* entry) {
+ ImportedBookmarkEntry* entry) {
DCHECK(reader);
DCHECK(entry);
@@ -488,7 +489,7 @@ bool Toolbar5Importer::ExtractUrlFromXmlReader(
bool Toolbar5Importer::ExtractTimeFromXmlReader(
XmlReader* reader,
- ProfileWriter::BookmarkEntry* entry) {
+ ImportedBookmarkEntry* entry) {
DCHECK(reader);
DCHECK(entry);
if (!LocateNextTagWithStopByName(reader, kTimestampXmlTag, kLabelsXmlTag))
@@ -563,7 +564,7 @@ bool Toolbar5Importer::ExtractFoldersFromXmlReader(
}
void Toolbar5Importer::AddBookmarksToChrome(
- const std::vector<ProfileWriter::BookmarkEntry>& bookmarks) {
+ const std::vector<ImportedBookmarkEntry>& bookmarks) {
if (!bookmarks.empty() && !cancelled()) {
const string16& first_folder_name =
bridge_->GetLocalizedString(IDS_BOOKMARK_GROUP_FROM_GOOGLE_TOOLBAR);

Powered by Google App Engine
This is Rietveld 408576698