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

Disabling Ads Panel for disallowed regions #1941

Merged
merged 1 commit into from
Mar 21, 2019
Merged

Conversation

ryanml
Copy link
Contributor

@ryanml ryanml commented Mar 14, 2019

Fixes: brave/brave-browser#2562
UI: brave/brave-ui#427

Screen Shot 2019-03-13 at 7 05 04 PM

Submitter Checklist:

  • Submitted a ticket for my issue if one did not already exist.
  • Used Github auto-closing keywords in the commit message.
  • Added/updated tests for this change (for new code or code which already has tests).
  • Verified that these changes build without errors on
    • Windows
    • macOS
    • Linux
  • Verified that these changes pass automated tests (npm test brave_unit_tests && npm test brave_browser_tests) on
    • Windows
    • macOS
    • Linux
  • Verified that all lint errors/warnings are resolved (npm run lint)
  • Ran git rebase master (if needed).
  • Ran git rebase -i to squash commits (if needed).
  • Tagged reviewers and labelled the pull request as needed.
  • Request a security/privacy review as needed.
  • Add appropriate QA labels (QA/Yes or QA/No) to include the closed issue in milestone

Test Plan:

  1. Launch Brave with a clean profile, opt in to Rewards
  2. If you are inside a supported region (US, CA, DE, FR, GB) you should see Ads enabled and configurable as expected.
  3. If not, check that the panel is disabled and cannot be turned on
  4. Modify the allowed regions vector here for testing purposes: (Add your own region or remove the one you're in) https://github.com/brave/brave-core/blob/master/vendor/bat-native-ads/src/bat/ads/internal/ads_impl.cc#L326
    (Unfortunately the flag does not work anymore)
  5. Reset profile and rebuild and relaunch Brave.
  6. Repeat steps 2 and 3 for a few different regions

Reviewer Checklist:

  • New files have MPL-2.0 license header.
  • Request a security/privacy review as needed.
  • Adequate test coverage exists to prevent regressions
  • Verify test plan is specified in PR before merging to source

cc: @jsecretan

@ryanml ryanml added this to the 0.64.x - Nightly milestone Mar 14, 2019
@ryanml ryanml self-assigned this Mar 14, 2019
@ryanml ryanml changed the title Disabling Ads Panel for disallowed region Disabling Ads Panel for disallowed regions Mar 14, 2019
tmancey
tmancey previously approved these changes Mar 14, 2019
Copy link
Collaborator

@tmancey tmancey left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

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

LGTM. Would make change left from comment and retest

components/brave_ads/browser/ads_service.h Outdated Show resolved Hide resolved
@ryanml ryanml requested a review from NejcZdovc March 14, 2019 22:53
@ryanml ryanml force-pushed the ads-supported-region branch 4 times, most recently from cfc392a to 17b193e Compare March 20, 2019 03:56
@ryanml ryanml force-pushed the ads-supported-region branch 2 times, most recently from c367279 to 28f7ebc Compare March 20, 2019 19:10
@ryanml ryanml requested a review from tmancey March 21, 2019 02:11
@jasonrsadler
Copy link
Contributor

jasonrsadler commented Mar 21, 2019

nit
The Get can be dropped off the boolean method names.

Copy link
Contributor

@jasonrsadler jasonrsadler left a comment

Choose a reason for hiding this comment

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

++ lgtm

@ryanml ryanml merged commit a8b9794 into master Mar 21, 2019
@ryanml ryanml deleted the ads-supported-region branch March 21, 2019 02:41
ryanml added a commit that referenced this pull request Mar 21, 2019
Disabling Ads Panel for disallowed regions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Gray out Ads Panel for certain countries
4 participants