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

Unified Diff: chrome/utility/importer/safari_importer.mm

Issue 119833002: [Import] [OSX] Don't create an empty folder when importing from Safari with an empty Bookmarks Menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove extraneous files, update READMEs Created 6 years, 11 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 | « chrome/utility/importer/safari_importer.h ('k') | chrome/utility/importer/safari_importer_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/importer/safari_importer.mm
diff --git a/chrome/utility/importer/safari_importer.mm b/chrome/utility/importer/safari_importer.mm
index ef06b8aaf91e8ec752ab9f9b3418bdee36f9bf2b..177d268e97259f28ac3cb777f450df7c56ec3c35 100644
--- a/chrome/utility/importer/safari_importer.mm
+++ b/chrome/utility/importer/safari_importer.mm
@@ -194,9 +194,12 @@ void SafariImporter::RecursiveReadBookmarksFolder(
}
NSArray* elements = [bookmark_folder objectForKey:@"Children"];
- if (!elements && (!parent_path_elements.empty() || !is_in_toolbar)) {
- // This is an empty folder, so add it explicitly; but don't add the toolbar
- // folder if it is empty. Note that all non-empty folders are added
+ if (!elements &&
+ (!parent_path_elements.empty() || !is_in_toolbar) &&
+ ![title isEqualToString:@"BookmarksMenu"]) {
+ // This is an empty folder, so add it explicitly. Note that the condition
+ // above prevents either the toolbar folder or the bookmarks menu from being
+ // added if either is empty. Note also that all non-empty folders are added
// implicitly when their children are added.
ImportedBookmarkEntry entry;
// Safari doesn't specify a creation time for the folder.
« no previous file with comments | « chrome/utility/importer/safari_importer.h ('k') | chrome/utility/importer/safari_importer_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698