Add bookmark import/export actions: remove the 10 MB limit for importing bookmarks (#2527)

This commit is contained in:
Carmelo Messina
2025-12-02 17:01:28 +01:00
parent 8a6d940119
commit 03ac6cfc47
@@ -17,7 +17,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
.../app/bookmarks/BookmarkActivity.java | 32 ++
.../native_page/NativePageFactory.java | 9 +-
chrome/browser/BUILD.gn | 11 +-
.../bookmarks/android/bookmark_bridge.cc | 197 ++++++++++++
.../bookmarks/android/bookmark_bridge.cc | 192 ++++++++++++
.../bookmarks/android/bookmark_bridge.h | 30 +-
.../browser/bookmarks/BookmarkBridge.java | 39 +++
.../browser/bookmarks/BookmarkDelegate.java | 10 +
@@ -51,7 +51,7 @@ License: GPL-3.0-only - https://spdx.org/licenses/GPL-3.0-only.html
ui/shell_dialogs/select_file_dialog_linux.cc | 4 +
ui/shell_dialogs/select_file_dialog_linux.h | 2 +
ui/shell_dialogs/select_file_dialog_win.cc | 5 +
40 files changed, 810 insertions(+), 24 deletions(-)
40 files changed, 805 insertions(+), 24 deletions(-)
create mode 100644 cromite_flags/chrome/browser/about_flags_cc/add-bookmark-import-export-actions.inc
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_cc/add-bookmark-import-export-actions.inc
create mode 100644 cromite_flags/chrome/browser/flags/android/chrome_feature_list_h/add-bookmark-import-export-actions.inc
@@ -322,7 +322,7 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse
}
void BookmarkBridge::Destroy(JNIEnv* env) {
@@ -847,6 +873,177 @@ jint BookmarkBridge::GetTotalBookmarkCount(
@@ -847,6 +873,172 @@ jint BookmarkBridge::GetTotalBookmarkCount(
return count;
}
@@ -449,11 +449,6 @@ diff --git a/chrome/browser/bookmarks/android/bookmark_bridge.cc b/chrome/browse
+ return "";
+ }
+
+ if (fileLength > 10 * 1024 * 1024) {
+ select_file_dialog_->ShowToast("Bookmark file is bigger than 10MB");
+ return "";
+ }
+
+ std::vector<char> buffer(fileLength);
+ if (-1 == file.ReadAtCurrentPos(buffer.data(), fileLength)) {
+ select_file_dialog_->ShowToast("Could not read bookmarks file");