-
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
Added ms-edge protocol handler option #10879
Conversation
@rebron Needs above options's all texts. |
10e64f3
to
3a352f9
Compare
0988b4d
to
261efb9
Compare
c92206d
to
9f379a1
Compare
this is crazy! (I love it) 😀 |
9f379a1
to
d45f6ea
Compare
9c5de9f
to
b6a61ff
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.
@goodov @bsclifton Comments are all addressed. PTAL again!
browser/ui/webui/new_tab_page/ms_edge_protocol_message_handler.cc
Outdated
Show resolved
Hide resolved
b6a61ff
to
30eea76
Compare
As ms will not allow setting 3p applications as a default ms-edge protocol handler, this option should not be visible from that version (Win11, 22494 build). See https://www.ctrl.blog/entry/microsoft-edge-protocol-competition.html
30eea76
to
346a6f6
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.
Code looks great and works perfectly. After setting to default, it hides the button. When default is changed away from Brave, button re-appears. Thanks for putting in the Windows 11 version check for 22494 😄
@simonhong & @rebron — text lgtm. No changes. |
Merged as only upload step was failed in CI. |
Added ms-edge protocol handler option
Added ms-edge protocol handler option
Verification PASSED on
Verification PASSED on
|
While running through the verifications via #10879 (comment), I did run into the following: However, this is a |
|
||
void MSEdgeProtocolMessageHandler::OnRegValChanged() { | ||
CheckMSEdgeProtocolDefaultHandlerState(); | ||
StartWatching(); |
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.
this doesn't seem right, aren't we already watching it? What happens if you call StartWatching
more than once on the same key?
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 RegistryMonitor does this, but why aren't we using that?
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.
Calling StartWatching
from callback doesn't make any issue because it's onetime watching.
// To stop watching, delete this RegKey object. To continue watching the
// object after the callback is invoked, call StartWatching again.
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.
Well, RegistryMonitor
seems installer specific (it inherits InstalledVersionMonitor
interface).
And the logic for monitoring is quite simple.
fix brave/brave-browser#17558
Applied below FF's implementation to set default handler w/o using windows system ui.
It calculated hash value by using some properties such as user sid, protocol or timestamp.
If this method is not available, system ui will be launched instead.
https://github.com/mozilla/gecko-dev/blob/master/toolkit/mozapps/defaultagent/SetDefaultBrowser.cpp
Resolves
Option state when brave is not yet set for ms-edge protocol handler

Option state when brave is ms-edge protocol handler

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:
npm run test brave_unit_tests -- --filter=DefaultProtocolHandlerUtilsWinTest
Test 1
brave://settings/system/
Make default
button is visible and clickbrave://settings/system/
is updated properlyTest 2
--use-system-ui-for-ms-edge
cmd line switchbrave://settings/system/
and click buttonNOTE: With Older than Windows 10 RS2, system ui will be launched.