-
Notifications
You must be signed in to change notification settings - Fork 904
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
Rewards extension in brave bar #431
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.
This all looks and works great to me. I'm going to get an updated icon to put in as the vertical alignment is off. Even though it's a placeholder, I think this PR can own the look on the toolbar and then brave/brave-browser#920 can own the content area.
In the meantime we should ask @yrliou to review, who just completed similar work on an extension.
@petemill, thanks, I was going to ping Ross about the icons. If you are going to get them, should we add all sizes like we do for the shields extension (vendor/brave-extension/app/assets/img)? Please, let me know if you want me to follow up. |
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.
Extension resources packing and loading looks good to me, a few small comments left, nothing major.
@@ -35,6 +37,15 @@ void BraveComponentLoader::AddDefaultComponentExtensions( | |||
Add(IDR_BRAVE_EXTENSON, brave_extension_path); | |||
} | |||
|
|||
#if BUILDFLAG(BRAVE_REWARDS_ENABLED) && !defined(OFFICIAL_BUILD) | |||
if (!command_line.HasSwitch(switches::kDisableBraveRewardsExtension)) { |
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.
Do we have corresponding changes in brave-browser for adding this command line switch?
@@ -35,6 +37,15 @@ void BraveComponentLoader::AddDefaultComponentExtensions( | |||
Add(IDR_BRAVE_EXTENSON, brave_extension_path); | |||
} | |||
|
|||
#if BUILDFLAG(BRAVE_REWARDS_ENABLED) && !defined(OFFICIAL_BUILD) |
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.
Could we have a note here that !defined(OFFICIAL_BUILD) should be removed when we have some actual UI?
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.
Will add a comment
browser/resources/resource_ids
Outdated
@@ -22,4 +22,7 @@ | |||
"includes": [36500], | |||
}, | |||
# brave webtorrent 37500 | |||
"brave/components/brave_rewards/resources.grd": { | |||
"includes": [37600], |
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.
As discussed offline, let's do 38000 here, thanks!
// Don't show the Brave and Rewards 'extensions' in the ToolbarActions | ||
// extensions area. They will instead be shown in the BraveActions area. | ||
if (extension->id() == brave_extension_id || | ||
extension->id() == brave_rewards_extension_id) { |
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: align with previous line?
"browser_action": { | ||
"default_popup": "extension/popup.html", | ||
"default_icon": "extension/img/BAT_icon_placeholder_32.png" | ||
}, |
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.
extensions should have CSP defined, tho probably fine since it's still just a stub right 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.
Right, my assumption is that whomever implements the actual extension will add the appropriate CSP.
Fixes #1103 Related: brave/brave-core#431 You can do this with: ``` npm run start -- --disable_brave_rewards_extension ``` or ``` yarn start --disable_brave_rewards_extension ```
@mkarolin here's some updated icons for the extension if we want to get that in here before it's merged https://www.dropbox.com/s/370cc0dtowvh45p/brave-payments-extension-icon.zip?dl=0 Additionally, it would be great to squash some of these commits so that anything fixed or any changes in response to reviews are squashed in to the commit that the change originated in. |
e2a1a43
to
e4149ec
Compare
Updated with actual extension icons. Squashed code review commits. |
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.
Really nice - works perfectly! 🎉
Rewards extension in brave bar
0.55.x 45cc8b3 |
added merged/0.55.x label |
Revert "add toggle for enable_distro_version_check"
Revert "add toggle for enable_distro_version_check"
Revert "add toggle for enable_distro_version_check"
Fixes brave/brave-browser#669
Adds a placeholder for Rewards extension (the real extension code is to be implemented separately).
Places the extension into resource pack and provides necessary wiring to load the extension from resources. The loading of extension is predicated on BRAVE_REWARDS_ENABLED flag due to pending port of anonize.
Removes the Rewards extension button from main extensions area (ToolbarActionsBar / BrowserActionsContainer) and places it into BraveActionsBar in the omnibox.
Rewards extension button inherits behavior of BraveActionsBar buttons: disabled context menu, no drag&drop of buttons within the bar.
Renames ShieldsActionViewController to BraveActionViewController as the controller is now used for both Shields and Rewards action views. Due to renaming patches/chrome-browser-ui-extensions-extension_action_view_controller.h.patch had to be updated with the new name.
This PR should not be merged because it contains placeholder UI for Rewards extension.
Submitter Checklist:
git rebase -i
to squash commits (if needed).Test Plan:
Reviewer Checklist: