-
Notifications
You must be signed in to change notification settings - Fork 920
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
import export bookmarks android #17821
Conversation
cd64552
to
f2a05e0
Compare
b1cc736
to
979befd
Compare
android/java/org/chromium/chrome/browser/bookmarks/BraveBookmarkManagerMediator.java
Outdated
Show resolved
Hide resolved
build/android/bytecode/java/org/brave/bytecode/BraveBookmarkManagerMediatorClassAdapter.java
Outdated
Show resolved
Hide resolved
build/android/bytecode/java/org/brave/bytecode/BraveBookmarkManagerMediatorClassAdapter.java
Outdated
Show resolved
Hide resolved
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.
++
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.
lgtm
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.
++
chromium_src/chrome/browser/bookmarks/android/bookmark_bridge.cc
Outdated
Show resolved
Hide resolved
base::FilePath file_export_path = | ||
base::FilePath::FromUTF16Unsafe(export_path); | ||
|
||
BookmarksExportObserver* observer = new FileBookmarksExportObserver(obj); |
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.
What's deleting this?
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.
If we don't need to use the observer, then it seems like we can just pass in a nullptr
like upstream does here.
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.
we need to use this observer to get the result for exporting the bookmarks to display success or failure dialog to the user.
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.
Oh I see, it deletes itself in OnExportFinished
. Got it. Thanks.
if (is_android) { | ||
brave_common_sources = [ | ||
"//chrome/common/importer/imported_bookmark_entry.cc", | ||
"//chrome/common/importer/imported_bookmark_entry.h", | ||
] | ||
} |
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.
Suggestion to minimize patching:
brave_common_sources = [] if (is_android) { brave_common_sources += [ "//chrome/common/importer/imported_bookmark_entry.cc", "//chrome/common/importer/imported_bookmark_entry.h", ] }
and then there would be no need to have the if (is_android)
in patches/chrome-common-BUILD.gn.patch
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.
Sure, I'll update it
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.
LGTM
0dd1ffe
to
d4cfc48
Compare
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.
nit : we should have newline for all new classes.
@@ -48,6 +48,7 @@ brave_java_sources = [ | |||
"../../brave/android/java/org/chromium/chrome/browser/app/BraveActivity.java", | |||
"../../brave/android/java/org/chromium/chrome/browser/app/appmenu/AppMenuIconRowFooter.java", | |||
"../../brave/android/java/org/chromium/chrome/browser/app/appmenu/BraveAppMenuPropertiesDelegateImpl.java", | |||
"../../brave/android/java/org/chromium/chrome/browser/app/bookmarks/BraveBookmarkActivity.java", |
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.
@tapanmodh can we move BraveBookmarkActivity to bookmark directory ?
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.
BraveBookmarkActivity is in same place as BookmarkActivity from chromium. I think we shouldn't move to bookmark directory.
android:theme="@style/Theme.Chromium.Activity.Fullscreen" | ||
android:exported="false" | ||
android:windowSoftInputMode="stateAlwaysHidden|adjustResize" | ||
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|mcc|mnc|screenLayout|smallestScreenSize"/> |
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.
Just curious, Why do we need MCC
and MNC
here ? i think it's useful when we need to have configChanges for mobile country code change.
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.
I just use the same as BookmarkActivity has in chromium AndroidManifest
if (mWindowAndroid.handlePermissionResult(requestCode, permissions, grantResults)) return; | ||
super.onRequestPermissionsResult(requestCode, permissions, grantResults); | ||
} | ||
} |
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.
nit : newline at the end
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.
I think newline is there in the code
deleteField(sBraveBookmarkActivityClassName, "mBookmarkManagerCoordinator"); | ||
makeProtectedField(sBookmarkActivityClassName, "mBookmarkManagerCoordinator"); | ||
} | ||
} |
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.
nit : newline at the end
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.
I think newline is there in the code
deleteField(sBraveBookmarkBridgeClassName, "mNativeBookmarkBridge"); | ||
makeProtectedField(sBookmarkBridgeClassName, "mNativeBookmarkBridge"); | ||
} | ||
} |
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.
nit : newline at the end
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.
I think newline is there in the code
deleteField(sBraveBookmarkManagerMediatorClassName, "mContext"); | ||
makeProtectedField(sBookmarkManagerMediatorClassName, "mContext"); | ||
} | ||
} |
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.
nit : newline at the end
deleteMethod(sBraveBookmarkModelClassName, "importBookmarks"); | ||
deleteMethod(sBraveBookmarkModelClassName, "exportBookmarks"); | ||
} | ||
} |
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.
nit : newline at the end
deleteField(sBraveBookmarkPageClassName, "mManager"); | ||
makeProtectedField(sBookmarkPageClassName, "mManager"); | ||
} | ||
} |
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.
nit : newline at the end
deleteField(sBraveBookmarkToolbarClassName, "mBookmarkModel"); | ||
makeProtectedField(sBookmarkToolbarClassName, "mBookmarkModel"); | ||
} | ||
} |
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.
nit : newline at the end
deleteField(sBraveBookmarkToolbarCoordinatorClassName, "mToolbar"); | ||
makeProtectedField(sBookmarkToolbarCoordinatorClassName, "mToolbar"); | ||
} | ||
} |
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.
nit : newline at the end
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.
LGTM
#include "chrome/browser/bookmarks/bookmark_html_writer.h" | ||
#include "chrome/browser/importer/profile_writer.h" | ||
#include "chrome/common/url_constants.h" | ||
#include "chrome/utility/importer/bookmark_html_reader.h" |
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.
utility process code cannot be include in the browser process
@@ -194,6 +194,7 @@ brave_chrome_browser_deps = [ | |||
"//chrome/browser/ui", | |||
"//chrome/common", | |||
"//chrome/common:channel_info", | |||
"//chrome/utility", |
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.
utility process code cannot be included in the browser process
Resolves brave/brave-browser#6378
Submitter Checklist:
QA/Yes
orQA/No
;release-notes/include
orrelease-notes/exclude
;OS/...
) to the associated issuenpm run test -- brave_browser_tests
,npm run test -- brave_unit_tests
wikinpm run lint
,npm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan:
Import Bookmarks:
Users can import an HTML file containing bookmarks via the bookmarks screen.
Export Bookmarks
Users should be able to export an HTML file containing bookmarks from the bookmarks screen.
device-2023-04-11-174934.mp4