-
Notifications
You must be signed in to change notification settings - Fork 888
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Replace com.apple.ReadingList by Reading List #16784
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,15 +5,46 @@ | |
|
||
#include <Cocoa/Cocoa.h> | ||
|
||
#include <vector> | ||
|
||
#include "base/files/file_util.h" | ||
#include "base/logging.h" | ||
#include "chrome/common/importer/imported_bookmark_entry.h" | ||
#include "chrome/grit/generated_resources.h" | ||
#include "chrome/utility/importer/safari_importer.h" | ||
#include "ui/base/l10n/l10n_util.h" | ||
|
||
namespace { | ||
|
||
int GetBookmarkGroupFromSafariID() { | ||
return IDS_BOOKMARK_GROUP_FROM_SAFARI; | ||
} | ||
|
||
constexpr char16_t kSafariReadingListPath[] = u"com.apple.ReadingList"; | ||
|
||
void CorrectSafariReadingListPath( | ||
std::vector<ImportedBookmarkEntry>& bookmarks) { | ||
for (auto& item : bookmarks) { | ||
for (auto& folder : item.path) { | ||
if (folder == kSafariReadingListPath) { | ||
folder = l10n_util::GetStringUTF16(IDS_BOOKMARKS_READING_LIST_GROUP); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit: don't need There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Im not sure that we can have only one path |
||
} | ||
} | ||
} | ||
} | ||
} // namespace | ||
|
||
#define fileSystemRepresentation fileSystemRepresentation]; \ | ||
int64_t file_size = 0; \ | ||
if (base::GetFileSize(base::FilePath(db_path), &file_size) && !file_size) { \ | ||
return false; \ | ||
} \ | ||
VLOG(1) << [favicons_db_path fileSystemRepresentation | ||
|
||
#undef IDS_BOOKMARK_GROUP_FROM_SAFARI | ||
#define IDS_BOOKMARK_GROUP_FROM_SAFARI GetBookmarkGroupFromSafariID()); \ | ||
CorrectSafariReadingListPath(bookmarks | ||
#include "src/chrome/utility/importer/safari_importer.mm" | ||
#undef IDS_BOOKMARK_GROUP_FROM_SAFARI | ||
#define IDS_BOOKMARK_GROUP_FROM_SAFARI GetBookmarkGroupFromSafariID() | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need this define here? I think it doesn't have any meaning. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
#undef fileSystemRepresentation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.