-
Notifications
You must be signed in to change notification settings - Fork 868
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
Userlytics feedback android #7513
Conversation
* An internal version of {@link #addBookmarkSilently(Context, BookmarkModel, String, String)}. | ||
* Will reset last used parent if it fails to add a bookmark | ||
*/ | ||
private static BookmarkId addBookmarkInternal( |
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.
@samartnik Created an issue to add support for static functions. brave/brave-browser#13359 so instead of adding a patch, i have copied the function 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.
does that function somehow different of what we have inside BookmarkUtils.java? Why do we need to duplicate it as we can call it via that BookmarkUtils.addBookmarkInternal
as it's static.
@@ -0,0 +1,153 @@ | |||
// Copyright 2020 The Chromium Authors. All rights reserved. |
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.
Should be our header
public BraveBookmarkUtilsClassAdapter(ClassVisitor visitor) { | ||
super(visitor); | ||
changeMethodOwner( | ||
sBookmarkUtilsClassName, "addOrEditBookmark", sBraveBookmarkUtilsClassName); |
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.
Please add checks in testClassesExist
and testMethodsExist
in brave/android/javatests/org/chromium/chrome/browser/BytecodeTest.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.
And whitelist it for tests here brave/android/java/apk_for_test.flags
changeMethodOwner( | ||
sBookmarkUtilsClassName, "addOrEditBookmark", sBraveBookmarkUtilsClassName); | ||
} | ||
} |
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: last empty line
<solid android:color="@color/onboarding_bg_color"/> | ||
<stroke android:width="1dp" android:color="#E9E9F4" /> | ||
<corners android:radius="10dp"/> | ||
</shape> |
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: last empty line
}, | ||
Snackbar.TYPE_NOTIFICATION, Snackbar.UMA_BOOKMARK_ADDED) | ||
.setSingleLine(false); | ||
RecordUserAction.record("EnhancedBookmarks.AddingFailed"); |
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.
let's remove that, it's used to track user's activity in chrome
return new SnackbarController() { | ||
@Override | ||
public void onDismissNoAction(Object actionData) { | ||
RecordUserAction.record("EnhancedBookmarks.EditAfterCreateButtonNotClicked"); |
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.
the same as a previous comment about RecordUserAction
|
||
@Override | ||
public void onAction(Object actionData) { | ||
RecordUserAction.record("EnhancedBookmarks.EditAfterCreateButtonClicked"); |
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.
the same as a previous comment about RecordUserAction
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
Resolves brave/brave-browser#11939
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
,npm run lint
,npm run gn_check
,npm run tslint
git rebase master
(if needed).Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on.
Test Plan: