-
Notifications
You must be signed in to change notification settings - Fork 879
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
Support permission lifetime options for "Block" decision. #8693
Conversation
|
||
void PermissionDialogDelegate::Accept(JNIEnv* env, | ||
const JavaParamRef<jobject>& obj) { | ||
+ BRAVE_PERMISSION_DIALOG_DELEGATE_ACCEPT | ||
permission_prompt_->Accept(); | ||
} | ||
|
||
void PermissionDialogDelegate::Cancel(JNIEnv* env, | ||
const JavaParamRef<jobject>& obj) { | ||
+ BRAVE_PERMISSION_DIALOG_DELEGATE_CANCEL |
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 with Cancel
you can redefine the method in chromium_src
for .h and .cc. It wasn't possible for Accept
since it also calls Accept
internally, but Cancel
calls Deny
, so maybe we can avoid this part of the 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.
#define Cancel \
Cancel_ChromiumImpl(JNIEnv* env, const JavaParamRef<jobject>& obj); \
void Cancel(JNIEnv* env, const JavaParamRef<jobject>& obj);
this doesn't work because Cancel
is widely used everywhere and I see some weird errors:
In file included from ../../mojo/public/cpp/bindings/lib/interface_ptr_state.h:31:
In file included from ../../mojo/public/cpp/bindings/lib/multiplex_router.h:29:
In file included from ../../mojo/public/cpp/bindings/connector.h:24:
In file included from ../../mojo/public/cpp/system/handle_signal_tracker.h:12:
../../mojo/public/cpp/system/simple_watcher.h:143:8: error: no template named 'JavaParamRef'; did you mean 'base::android::JavaParamRef'?
void Cancel();
not sure how it can be done the other way, because it's a JNI method and JNI-generated code expects exactly PermissionDialogDelegate::Cancel
method. I don't see an option to make it virtual with a define because it's also widely used.
are there some other options I don't see?
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.
Ok, if it messes up a lot of other files, let's just go with a patch. Thanks for trying.
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
and patches
changes LGTM
Verified
Cases20 seconds, Allow permission (camera + microphone):
Origin-based behavior, multiple tabs (location):
23-hours positive test (microphone):
Consecutive-revocation permissions (location)
Block forever (notifications):
|
Extend permission lifetime logic to support lifetime options for "Block" decision.
Resolves brave/brave-browser#15603
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: