Skip to content
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

Disable Greaselion if Rewards is off #25535

Merged
merged 2 commits into from
Sep 12, 2024

Conversation

atuchin-m
Copy link
Collaborator

@atuchin-m atuchin-m commented Sep 12, 2024

Resolves brave/brave-browser#40872

Submitter Checklist:

  • I confirm that no security/privacy review is needed and no other type of reviews are needed, or that I have requested them
  • There is a ticket for my issue
  • Used Github auto-closing keywords in the PR description above
  • Wrote a good PR/commit description
  • Squashed any review feedback or "fixup" commits before merge, so that history is a record of what happened in the repo, not your PR
  • Added appropriate labels (QA/Yes or QA/No; release-notes/include or release-notes/exclude; OS/...) to the associated issue
  • Checked the PR locally:
    • npm run test -- brave_browser_tests, npm run test -- brave_unit_tests wiki
    • npm run presubmit wiki, npm run gn_check, npm run tslint
  • Ran git rebase master (if needed)

Reviewer Checklist:

  • A security review is not needed, or a link to one is included in the PR description
  • New files have MPL-2.0 license header
  • Adequate test coverage exists to prevent regressions
  • Major classes, functions and non-trivial code blocks are well-commented
  • Changes in component dependencies are properly reflected in gn
  • Code follows the style guide
  • Test plan is specified in PR before merging

After-merge Checklist:

Test Plan:

brave/brave-browser#39610 (comment)

@atuchin-m atuchin-m self-assigned this Sep 12, 2024
@@ -270,6 +270,9 @@ GreaselionServiceImpl::GetExtensionIdsForTesting() {
}

void GreaselionServiceImpl::UpdateInstalledExtensions() {
if (!delegate_->IsEnabled()) {
return;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this unload currently installed Greaselion extensions if it's disabled? If not, should it? I'm wondering if this check could go in CreateAndInstallExtensions. @emerick WDYT?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nope, it doesn't just to simplify the code.
IMHO it's okay to have the extensions loaded if the users changed Rewards state, since it's a rare case.
The goal is to cover the usual scenarios to improve perf.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That sounds fine. In that case, the intended behavior here is that GL extensions will not be added or updated if Rewards is disabled. They will remain as-is if Rewards is disabled via reset.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me.

@zenparsing zenparsing requested a review from emerick September 12, 2024 12:00
#include "brave/components/greaselion/browser/greaselion_service.h"
#include "brave/components/greaselion/browser/greaselion_service_impl.h"
#include "chrome/browser/extensions/extension_service.h"
#include "chrome/browser/profiles/profile.h"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we check if these need deps?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, updated sources.gni.

Frankly, I don't full understand that approach with "components" in brave/browser/ until chrome does the same.
If fact, we push all the deps into a one list and non on them can be build separately.

@atuchin-m atuchin-m requested a review from a team as a code owner September 12, 2024 14:12
@atuchin-m atuchin-m requested review from goodov September 12, 2024 14:16
@atuchin-m atuchin-m enabled auto-merge (squash) September 12, 2024 15:29
@atuchin-m atuchin-m force-pushed the disable-greaselion-service-if-rewards-is-off branch from 03bfc8d to e443e96 Compare September 12, 2024 19:41
@atuchin-m atuchin-m merged commit 81199be into master Sep 12, 2024
18 of 19 checks passed
@atuchin-m atuchin-m deleted the disable-greaselion-service-if-rewards-is-off branch September 12, 2024 20:50
@github-actions github-actions bot added this to the 1.72.x - Nightly milestone Sep 12, 2024
jagadeshjai pushed a commit to jagadeshjai/brave-core that referenced this pull request Sep 14, 2024
* Disable Greaselion if Rewards is off
* update deps
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Disable Greaselion service if Rewards isn't enabled
4 participants