-
Notifications
You must be signed in to change notification settings - Fork 871
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 check includes #25685
Rewards check includes #25685
Conversation
590e715
to
c8ef420
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.
This is great - thanks!
#include "chrome/browser/ui/tabs/tab_strip_model.h" | ||
#endif | ||
|
||
namespace brave_rewards { | ||
|
||
#if !BUILDFLAG(IS_ANDROID) | ||
class BraveBrowserListObserver : public BrowserListObserver { |
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.
Up to you, but since this is only used within the tab helper, it could be a nested class or be given a more specific name.
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 wasn't really sure what to call it, but I'm open to suggestions
browser/brave_rewards/BUILD.gn
Outdated
source_set("brave_rewards") { | ||
sources = [ | ||
"//brave/browser/brave_rewards/rewards_service_factory.h", | ||
"//brave/browser/brave_rewards/rewards_tab_helper.h", |
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: consider fixing these paths to be local in all new targets you introduce in this PR:
"rewards_service_factory.h",
"rewards_tab_helper.h",
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.
oops, yep, copy-pasted the list and forgot to remove the full paths
} | ||
|
||
private: | ||
raw_ptr<RewardsTabHelper> tab_helper_; // Not owned. |
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.
const
all constructor-initialized pointers to trigger compile errors if initialization is missing.
source_set("brave_rewards_source") { | ||
sources = [ | ||
"webui/brave_rewards_source.cc", | ||
"webui/brave_rewards_source.h", |
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.
there's ui/webui/brave_rewards
dir. Would be nice to move this into it.
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.
trying to avoid any changes that aren't necessary here because it already touches a lot of stuff
[puLL-Merge] - brave/brave-core@25685 Here's my review of the pull request: DescriptionThis PR refactors the Brave Rewards service implementation to reduce dependencies and improve modularity. The main changes include:
ChangesChangesbrowser/brave_rewards/BUILD.gn
browser/brave_rewards/rewards_service_factory.cc
browser/brave_rewards/rewards_tab_helper.cc and .h
browser/greaselion/BUILD.gn
browser/sources.gni
browser/ui/BUILD.gn
components/brave_rewards/browser/BUILD.gn
components/brave_rewards/browser/rewards_service_impl.cc and .h
components/brave_rewards/browser/rewards_service_impl_unittest.cc and rewards_service_impl_jp_unittest.cc
Possible Issues
Security HotspotsNo significant security issues were identified in this change. Overall, this refactoring appears to be a positive change that improves the modularity and testability of the Brave Rewards service. It reduces coupling with the Profile class and makes dependencies more explicit, which should make the code easier to maintain and extend in the future. |
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.
browser/tor/test/BUILD.gn
change 👍
"//brave/components/resources", | ||
"//brave/components/services/bat_rewards/public/interfaces", | ||
"//brave/components/time_period_storage", | ||
"//chrome/browser/bitmap_fetcher", # bad |
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.
oops, I totally missed this before I merged it. Need to fix this one
Resolves brave/brave-browser#10618
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
wikinpm run presubmit
wiki,npm run gn_check
,npm run tslint
git rebase master
(if needed)Reviewer Checklist:
gn
After-merge Checklist:
changes has landed on
Test Plan: