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

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

Issue 15039004: Remove the dependence of the Firefox 3 importer on the Firefox 2 importer. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/firefox3_importer.cc
diff --git a/chrome/browser/importer/firefox3_importer.cc b/chrome/browser/importer/firefox3_importer.cc
index 7aee612a35ad72ee5271200f3c612c85aaacaa22..86ca3f13d32bbd1989c0f37a808eb8a0550c78e2 100644
--- a/chrome/browser/importer/firefox3_importer.cc
+++ b/chrome/browser/importer/firefox3_importer.cc
@@ -14,7 +14,7 @@
#include "base/utf_string_conversions.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/history/history_types.h"
-#include "chrome/browser/importer/firefox2_importer.h"
+#include "chrome/browser/importer/bookmarks_file_importer.h"
#include "chrome/browser/importer/firefox_importer_utils.h"
#include "chrome/browser/importer/importer_bridge.h"
#include "chrome/browser/importer/importer_util.h"
@@ -59,6 +59,21 @@ TemplateURL* CreateTemplateURL(const string16& title,
return new TemplateURL(NULL, data);
}
+// Loads the default bookmarks in the Firefox installed at |app_path|,
+// and stores their locations in |urls|.
+void LoadDefaultBookmarks(const base::FilePath& app_path,
+ std::set<GURL>* urls) {
+ base::FilePath file = app_path.AppendASCII("defaults")
+ .AppendASCII("profile")
+ .AppendASCII("bookmarks.html");
+ urls->clear();
+
+ std::vector<ProfileWriter::BookmarkEntry> bookmarks;
+ BookmarksFileImporter::ImportBookmarksFile(file, NULL, &bookmarks, NULL);
+ for (size_t i = 0; i < bookmarks.size(); ++i)
+ urls->insert(bookmarks[i].url);
+}
+
} // namespace
struct Firefox3Importer::BookmarkItem {
@@ -189,9 +204,9 @@ void Firefox3Importer::ImportBookmarks() {
std::set<int> livemark_id;
LoadLivemarkIDs(&db, &livemark_id);
- // Load the default bookmarks. Its storage is the same as Firefox 2.
+ // Load the default bookmarks.
std::set<GURL> default_urls;
- Firefox2Importer::LoadDefaultBookmarks(app_path_, &default_urls);
+ LoadDefaultBookmarks(app_path_, &default_urls);
BookmarkList list;
GetTopBookmarkFolder(&db, toolbar_folder_id, &list);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698