-
Notifications
You must be signed in to change notification settings - Fork 892
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
Introduce chrome.braveTheme api #774
Conversation
e920b1c
to
e667b52
Compare
Will remove |
9d43d63
to
b78bc05
Compare
event is added . Will remove WIP after adding test code for event. |
b78bc05
to
d366e77
Compare
d366e77
to
e7cea41
Compare
e7cea41
to
60e15ff
Compare
Kindly ping.. |
60e15ff
to
aed68f8
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 well, tests pass, code looks good. One minor comment on the json api description. I think to be useful we also need to allow the extensions and webui to differentiate to know what Default means.
Apologies for the delay - I was out sick. On the topic of @bbondy 's comment, I'd go further and suggest that this JS API should not expose In fact, we can use |
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.
Great job, I love the unified JS api approach. As per the comment, I'm suggesting we simplify and use GetActiveBraveThemeType
instead of GetUserPreferredBraveThemeType
. This should be backwards compatible with everything that's there, but only extra step we would need is to remove the 'default' select option on the settings page.
(another reason not to introduce parsing |
Received 👍 from design team on removing Default option for theme on Settings page so hopefully this is a straightforward call swap |
aed68f8
to
11a2828
Compare
GetUserPreferredBraveThemeType() is replaced with GetActiveBraveThemeType() in theme api. |
I considered that too but wondered if it'll ever be useful for us to know if the user has changed from what the default is or not. I'm ok with always doing light or dark though. |
@petemill I think this PR is ready to merge :) |
@simonhong I'm getting the following build error:
|
You likely have a patch applied unrelated to this commit that shouldn't exist for this branch. You can rebase to master or re-init. |
With this api, shields, rewards and many other webui can get brave theme information.
Not used anymore. BraveAppearanceHandler is replaced with chrome.braveTheme api.
Covered by BraveThemeAPIBrowserTest.BraveThemeEventRouterTest.
11a2828
to
64590d1
Compare
@petemill Rebased this PR on latest master now. |
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 is working great! I'll add a wiki doc on the usage
@petemill Thanks! 👍 |
Can we close brave/brave-browser#793 @petemill ? If so pls also update the issue milestone too, thanks!. |
@bbondy For this PR, brave/brave-browser#2348 is created and closed. |
With this new api, shields, rewards and many other webui can get brave
theme information.
Related Issue: brave/brave-browser#793
Close brave/brave-browser#2348
Submitter Checklist:
npm test brave_unit_tests && npm test brave_browser_tests
) ongit rebase master
(if needed).git rebase -i
to squash commits (if needed).Test Plan:
yarn test brave_browser_tests --filter=BraveThemeAPIBrowserTest*
Reviewer Checklist: