-
Notifications
You must be signed in to change notification settings - Fork 885
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
Added panel handler to run actions from vpn popup #13348
Conversation
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 check with security team that they are ok putting an extension API in chrome-untrusted. As far as I can see, this defeats the point of using chrome-untrusted. If we deem the code in the frame is not trustworthy and could be susceptible to being abused, then we would want to limit the abuse surface - and chrome.tabs has some things we might not want to be abused (e.g. opening a tab to a phishing site). |
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.
Actually; let's do with handlers as we discussed 😄
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.
Marking as "Request changes" until we have a security review or take a different approach. I think a preferred approach would be to add Mojom methods for UI actions, e.g. VisitSupportPage
would open the necessary URL in a new tab. That would be better for cross-platform too.
brave_vpn.mojom's ServiceHandler also seems like a good cross-platform place to put the handler's for these UI actions. |
d8a0859
to
b155347
Compare
This looks great! There are a few other places where chrome.tabs.create was used (doh; my bad). I think we can effectively remove this panel from that whitelist after this change is complete (no reason to keep Here are the places:
|
@@ -20,6 +20,9 @@ interface PanelHandler { | |||
|
|||
// Notify the backend that the dialog should be closed. | |||
CloseUI(); | |||
|
|||
// Run purchase action. | |||
RunPurchaseFlow(string action); |
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.
You think PanelHandler
is a better place than ServiceHandler
?
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.
yes, we need access to chrome/browser/ui
and VPNPanelHandler
has it. ServiceHandler
is on component level. Also that seems just click handlers, not the service logic
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 guess it's fine and if android needs similar we can think about it or duplicate it. But it's a click handler just as much as any other buttons which result in calls to service handler.
done |
ede9319
to
eb5e166
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.
Works beautifully 😄👍
82feaff
to
d528505
Compare
…alls in vpn panel popup
Resolves brave/brave-browser#22874
Resolves brave/brave-browser#22711
Resolves brave/brave-browser#22715
Resolves brave/brave-browser#22694
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: