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

Implement reminder notification: If user clicks same ad 3 times #17966

Merged
merged 5 commits into from
Apr 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions app/brave_generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -654,6 +654,12 @@ Or change later at <ph name="SETTINGS_EXTENIONS_LINK">$2<ex>brave://settings/ext
<message name="IDS_BRAVE_ADS_NOTIFICATION_EXTERNAL_WALLET_CONNECTED_BODY" desc="The notification body to show when an external wallet is connected">
For example, you earn whenever a notification like this appears on your screen. You don't need to click to earn.
</message>
<message name="IDS_BRAVE_ADS_NOTIFICATION_CLICKED_SAME_AD_MULTIPLE_TIMES_TITLE" desc="The notification title to show when a user clicks an ad multiple times">
You earn when a Brave Ads notification appears
</message>
<message name="IDS_BRAVE_ADS_NOTIFICATION_CLICKED_SAME_AD_MULTIPLE_TIMES_BODY" desc="The notification body to show when a user clicks an ad multiple times">
You don't need to click to earn, but do click if you're interested!
</message>

<!-- Brave Search -->
<message name="IDS_SETTINGS_WEB_DISCOVERY_LABEL" desc="Description that shows settings for toggle Web Discovery">
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/ads_service_factory.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class AdsServiceFactory : public BrowserContextKeyedServiceFactory {
AdsServiceFactory(const AdsServiceFactory&) = delete;
AdsServiceFactory& operator=(const AdsServiceFactory&) = delete;

AdsServiceFactory(AdsServiceFactory&& other) noexcept = delete;
AdsServiceFactory& operator=(AdsServiceFactory&& other) noexcept = delete;
AdsServiceFactory(AdsServiceFactory&&) noexcept = delete;
AdsServiceFactory& operator=(AdsServiceFactory&&) noexcept = delete;

static AdsService* GetForProfile(Profile* profile);

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/background_helper/background_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@ class BackgroundHelper {
BackgroundHelper(const BackgroundHelper&) = delete;
BackgroundHelper& operator=(const BackgroundHelper&) = delete;

BackgroundHelper(BackgroundHelper&& other) noexcept = delete;
BackgroundHelper& operator=(BackgroundHelper&& other) noexcept = delete;
BackgroundHelper(BackgroundHelper&&) noexcept = delete;
BackgroundHelper& operator=(BackgroundHelper&&) noexcept = delete;

virtual ~BackgroundHelper();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,8 @@ class BackgroundHelperAndroid
BackgroundHelperAndroid(const BackgroundHelperAndroid&) = delete;
BackgroundHelperAndroid& operator=(const BackgroundHelperAndroid&) = delete;

BackgroundHelperAndroid(BackgroundHelperAndroid&& other) noexcept = delete;
BackgroundHelperAndroid& operator=(BackgroundHelperAndroid&& other) noexcept =
BackgroundHelperAndroid(BackgroundHelperAndroid&&) noexcept = delete;
BackgroundHelperAndroid& operator=(BackgroundHelperAndroid&&) noexcept =
delete;

~BackgroundHelperAndroid() override;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,8 @@ class BackgroundHelperHolder final {
BackgroundHelperHolder(const BackgroundHelperHolder&) = delete;
BackgroundHelperHolder& operator=(const BackgroundHelperHolder&) = delete;

BackgroundHelperHolder(BackgroundHelperHolder&& other) noexcept = delete;
BackgroundHelperHolder& operator=(BackgroundHelperHolder&& other) noexcept =
delete;
BackgroundHelperHolder(BackgroundHelperHolder&&) noexcept = delete;
BackgroundHelperHolder& operator=(BackgroundHelperHolder&&) noexcept = delete;

static BackgroundHelperHolder* GetInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,8 @@ class BackgroundHelperLinux
BackgroundHelperLinux(const BackgroundHelperLinux&) = delete;
BackgroundHelperLinux& operator=(const BackgroundHelperLinux&) = delete;

BackgroundHelperLinux(BackgroundHelperLinux&& other) noexcept = delete;
BackgroundHelperLinux& operator=(BackgroundHelperLinux&& other) noexcept =
delete;
BackgroundHelperLinux(BackgroundHelperLinux&&) noexcept = delete;
BackgroundHelperLinux& operator=(BackgroundHelperLinux&&) noexcept = delete;

~BackgroundHelperLinux() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/background_helper/background_helper_mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ class BackgroundHelperMac : public BackgroundHelper {
BackgroundHelperMac(const BackgroundHelperMac&) = delete;
BackgroundHelperMac& operator=(const BackgroundHelperMac&) = delete;

BackgroundHelperMac(BackgroundHelperMac&& other) noexcept = delete;
BackgroundHelperMac& operator=(BackgroundHelperMac&& other) noexcept = delete;
BackgroundHelperMac(BackgroundHelperMac&&) noexcept = delete;
BackgroundHelperMac& operator=(BackgroundHelperMac&&) noexcept = delete;

~BackgroundHelperMac() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/background_helper/background_helper_win.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ class BackgroundHelperWin : public BackgroundHelper {
BackgroundHelperWin(const BackgroundHelperWin&) = delete;
BackgroundHelperWin& operator=(const BackgroundHelperWin&) = delete;

BackgroundHelperWin(BackgroundHelperWin&& other) noexcept = delete;
BackgroundHelperWin& operator=(BackgroundHelperWin&& other) noexcept = delete;
BackgroundHelperWin(BackgroundHelperWin&&) noexcept = delete;
BackgroundHelperWin& operator=(BackgroundHelperWin&&) noexcept = delete;

~BackgroundHelperWin() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/notification_helper/notification_helper.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class NotificationHelper final {
NotificationHelper(const NotificationHelper&) = delete;
NotificationHelper& operator=(const NotificationHelper&) = delete;

NotificationHelper(NotificationHelper&& other) noexcept = delete;
NotificationHelper& operator=(NotificationHelper&& other) noexcept = delete;
NotificationHelper(NotificationHelper&&) noexcept = delete;
NotificationHelper& operator=(NotificationHelper&&) noexcept = delete;

static NotificationHelper* GetInstance();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,8 @@ class NotificationHelperImpl {
NotificationHelperImpl(const NotificationHelperImpl&) = delete;
NotificationHelperImpl& operator=(const NotificationHelperImpl&) = delete;

NotificationHelperImpl(NotificationHelperImpl&& other) noexcept = delete;
NotificationHelperImpl& operator=(NotificationHelperImpl&& other) noexcept =
delete;
NotificationHelperImpl(NotificationHelperImpl&&) noexcept = delete;
NotificationHelperImpl& operator=(NotificationHelperImpl&&) noexcept = delete;

virtual ~NotificationHelperImpl();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ class NotificationHelperImplAndroid
NotificationHelperImplAndroid& operator=(
const NotificationHelperImplAndroid&) = delete;

NotificationHelperImplAndroid(
NotificationHelperImplAndroid&& other) noexcept = delete;
NotificationHelperImplAndroid(NotificationHelperImplAndroid&&) noexcept =
delete;
NotificationHelperImplAndroid& operator=(
NotificationHelperImplAndroid&& other) noexcept = delete;
NotificationHelperImplAndroid&&) noexcept = delete;

~NotificationHelperImplAndroid() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class NotificationHelperImplLinux
NotificationHelperImplLinux& operator=(const NotificationHelperImplLinux&) =
delete;

NotificationHelperImplLinux(NotificationHelperImplLinux&& other) noexcept =
delete;
NotificationHelperImplLinux(NotificationHelperImplLinux&&) noexcept = delete;
NotificationHelperImplLinux& operator=(
NotificationHelperImplLinux&& other) noexcept = delete;
NotificationHelperImplLinux&&) noexcept = delete;

~NotificationHelperImplLinux() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class NotificationHelperImplMac
NotificationHelperImplMac& operator=(const NotificationHelperImplMac&) =
delete;

NotificationHelperImplMac(NotificationHelperImplMac&& other) noexcept =
NotificationHelperImplMac(NotificationHelperImplMac&&) noexcept = delete;
NotificationHelperImplMac& operator=(NotificationHelperImplMac&&) noexcept =
delete;
NotificationHelperImplMac& operator=(
NotificationHelperImplMac&& other) noexcept = delete;

~NotificationHelperImplMac() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,9 @@ class NotificationHelperImplMock : public NotificationHelperImpl {
NotificationHelperImplMock& operator=(const NotificationHelperImplMock&) =
delete;

NotificationHelperImplMock(NotificationHelperImplMock&& other) noexcept =
NotificationHelperImplMock(NotificationHelperImplMock&&) noexcept = delete;
NotificationHelperImplMock& operator=(NotificationHelperImplMock&&) noexcept =
delete;
NotificationHelperImplMock& operator=(
NotificationHelperImplMock&& other) noexcept = delete;

~NotificationHelperImplMock() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,9 @@ class NotificationHelperImplWin
NotificationHelperImplWin& operator=(const NotificationHelperImplWin&) =
delete;

NotificationHelperImplWin(NotificationHelperImplWin&& other) noexcept =
NotificationHelperImplWin(NotificationHelperImplWin&&) noexcept = delete;
NotificationHelperImplWin& operator=(NotificationHelperImplWin&&) noexcept =
delete;
NotificationHelperImplWin& operator=(
NotificationHelperImplWin&& other) noexcept = delete;

~NotificationHelperImplWin() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ class NotificationAdPlatformBridge {
NotificationAdPlatformBridge& operator=(const NotificationAdPlatformBridge&) =
delete;

NotificationAdPlatformBridge(NotificationAdPlatformBridge&& other) noexcept =
NotificationAdPlatformBridge(NotificationAdPlatformBridge&&) noexcept =
delete;
NotificationAdPlatformBridge& operator=(
NotificationAdPlatformBridge&& other) noexcept = delete;
NotificationAdPlatformBridge&&) noexcept = delete;

~NotificationAdPlatformBridge();

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/tooltips/ads_captcha_tooltip.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class AdsCaptchaTooltip : public brave_tooltips::BraveTooltip {
AdsCaptchaTooltip(const AdsCaptchaTooltip&) = delete;
AdsCaptchaTooltip& operator=(const AdsCaptchaTooltip&) = delete;

AdsCaptchaTooltip(AdsCaptchaTooltip&& other) noexcept = delete;
AdsCaptchaTooltip& operator=(AdsCaptchaTooltip&& other) noexcept = delete;
AdsCaptchaTooltip(AdsCaptchaTooltip&&) noexcept = delete;
AdsCaptchaTooltip& operator=(AdsCaptchaTooltip&&) noexcept = delete;

~AdsCaptchaTooltip() override;

Expand Down
5 changes: 2 additions & 3 deletions browser/brave_ads/tooltips/ads_tooltips_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,8 @@ class AdsTooltipsController : public AdsTooltipsDelegate,
AdsTooltipsController(const AdsTooltipsController&) = delete;
AdsTooltipsController& operator=(const AdsTooltipsController&) = delete;

AdsTooltipsController(AdsTooltipsController&& other) noexcept = delete;
AdsTooltipsController& operator=(AdsTooltipsController&& other) noexcept =
delete;
AdsTooltipsController(AdsTooltipsController&&) noexcept = delete;
AdsTooltipsController& operator=(AdsTooltipsController&&) noexcept = delete;

~AdsTooltipsController() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/tooltips/ads_tooltips_delegate_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ class AdsTooltipsDelegateImpl : public AdsTooltipsDelegate {
AdsTooltipsDelegateImpl(const AdsTooltipsDelegateImpl&) = delete;
AdsTooltipsDelegateImpl& operator=(const AdsTooltipsDelegateImpl&) = delete;

AdsTooltipsDelegateImpl(AdsTooltipsDelegateImpl&& other) noexcept = delete;
AdsTooltipsDelegateImpl& operator=(AdsTooltipsDelegateImpl&& other) noexcept =
AdsTooltipsDelegateImpl(AdsTooltipsDelegateImpl&&) noexcept = delete;
AdsTooltipsDelegateImpl& operator=(AdsTooltipsDelegateImpl&&) noexcept =
delete;

~AdsTooltipsDelegateImpl() override = default;
Expand Down
8 changes: 4 additions & 4 deletions browser/ui/brave_ads/notification_ad.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,18 @@ class NotificationAd {
// Creates a copy of the |other| notification ad. The delegate, if any, will
// be identical for both notification ad instances. The |id| of the ad
// notification will be replaced by the given value
NotificationAd(const std::string& id, const NotificationAd& other);
NotificationAd(const std::string& id, const NotificationAd&);

// Creates a copy of the |other| notification ad. The delegate will be
// replaced by |delegate|
NotificationAd(scoped_refptr<NotificationAdDelegate> delegate,
const NotificationAd& other);
const NotificationAd&);

// Creates a copy of the |other| notification ad. The delegate, if any, will
// be identical for both notification ad instances
NotificationAd(const NotificationAd& other);
NotificationAd(const NotificationAd&);

NotificationAd& operator=(const NotificationAd& other);
NotificationAd& operator=(const NotificationAd&);

virtual ~NotificationAd();

Expand Down
5 changes: 2 additions & 3 deletions browser/ui/brave_ads/notification_ad_popup_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,9 @@ class NotificationAdPopupHandler final {
NotificationAdPopupHandler& operator=(const NotificationAdPopupHandler&) =
delete;

NotificationAdPopupHandler(NotificationAdPopupHandler&& other) noexcept =
NotificationAdPopupHandler(NotificationAdPopupHandler&&) noexcept = delete;
NotificationAdPopupHandler& operator=(NotificationAdPopupHandler&&) noexcept =
delete;
NotificationAdPopupHandler& operator=(
NotificationAdPopupHandler&& other) noexcept = delete;

~NotificationAdPopupHandler();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@ class NotificationAdBackgroundPainter : public views::Painter {
NotificationAdBackgroundPainter& operator=(
const NotificationAdBackgroundPainter&) = delete;

NotificationAdBackgroundPainter(
NotificationAdBackgroundPainter&& other) noexcept = delete;
NotificationAdBackgroundPainter(NotificationAdBackgroundPainter&&) noexcept =
delete;
NotificationAdBackgroundPainter& operator=(
NotificationAdBackgroundPainter&& other) noexcept = delete;
NotificationAdBackgroundPainter&&) noexcept = delete;

~NotificationAdBackgroundPainter() override;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,9 @@ class NotificationAdControlButtonsView : public views::View {
const NotificationAdControlButtonsView&) = delete;

NotificationAdControlButtonsView(
NotificationAdControlButtonsView&& other) noexcept = delete;
NotificationAdControlButtonsView&&) noexcept = delete;
NotificationAdControlButtonsView& operator=(
NotificationAdControlButtonsView&& other) noexcept = delete;
NotificationAdControlButtonsView&&) noexcept = delete;

~NotificationAdControlButtonsView() override;

Expand Down
6 changes: 3 additions & 3 deletions browser/ui/views/brave_ads/notification_ad_header_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,9 @@ class NotificationAdHeaderView : public views::View {
NotificationAdHeaderView(const NotificationAdHeaderView&) = delete;
NotificationAdHeaderView& operator=(const NotificationAdHeaderView&) = delete;

NotificationAdHeaderView(NotificationAdHeaderView&& other) noexcept = delete;
NotificationAdHeaderView& operator=(
NotificationAdHeaderView&& other) noexcept = delete;
NotificationAdHeaderView(NotificationAdHeaderView&&) noexcept = delete;
NotificationAdHeaderView& operator=(NotificationAdHeaderView&&) noexcept =
delete;

~NotificationAdHeaderView() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/views/brave_ads/notification_ad_popup.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ class NotificationAdPopup : public views::WidgetDelegateView,
NotificationAdPopup(const NotificationAdPopup&) = delete;
NotificationAdPopup& operator=(const NotificationAdPopup&) = delete;

NotificationAdPopup(NotificationAdPopup&& other) noexcept = delete;
NotificationAdPopup& operator=(NotificationAdPopup&& other) noexcept = delete;
NotificationAdPopup(NotificationAdPopup&&) noexcept = delete;
NotificationAdPopup& operator=(NotificationAdPopup&&) noexcept = delete;

~NotificationAdPopup() override;

Expand Down
6 changes: 3 additions & 3 deletions browser/ui/views/brave_ads/notification_ad_popup_collection.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ class NotificationAdPopupCollection final {
NotificationAdPopupCollection& operator=(
const NotificationAdPopupCollection&) = delete;

NotificationAdPopupCollection(
NotificationAdPopupCollection&& other) noexcept = delete;
NotificationAdPopupCollection(NotificationAdPopupCollection&&) noexcept =
delete;
NotificationAdPopupCollection& operator=(
NotificationAdPopupCollection&& other) noexcept = delete;
NotificationAdPopupCollection&&) noexcept = delete;

~NotificationAdPopupCollection();

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/views/brave_ads/notification_ad_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ class NotificationAdView : public views::View {
NotificationAdView(const NotificationAdView&) = delete;
NotificationAdView& operator=(const NotificationAdView&) = delete;

NotificationAdView(NotificationAdView&& other) noexcept = delete;
NotificationAdView& operator=(NotificationAdView&& other) noexcept = delete;
NotificationAdView(NotificationAdView&&) noexcept = delete;
NotificationAdView& operator=(NotificationAdView&&) noexcept = delete;

~NotificationAdView() override;

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/views/brave_ads/padded_image_button.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ class PaddedImageButton : public views::ImageButton {
PaddedImageButton(const PaddedImageButton&) = delete;
PaddedImageButton& operator=(const PaddedImageButton&) = delete;

PaddedImageButton(PaddedImageButton&& other) noexcept = delete;
PaddedImageButton& operator=(PaddedImageButton&& other) noexcept = delete;
PaddedImageButton(PaddedImageButton&&) noexcept = delete;
PaddedImageButton& operator=(PaddedImageButton&&) noexcept = delete;

~PaddedImageButton() override = default;

Expand Down
4 changes: 2 additions & 2 deletions browser/ui/views/brave_ads/padded_image_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ class PaddedImageView : public views::ImageView {
PaddedImageView(const PaddedImageView&) = delete;
PaddedImageView& operator=(const PaddedImageView&) = delete;

PaddedImageView(PaddedImageView&& other) noexcept = delete;
PaddedImageView& operator=(PaddedImageView&& other) noexcept = delete;
PaddedImageView(PaddedImageView&&) noexcept = delete;
PaddedImageView& operator=(PaddedImageView&&) noexcept = delete;

~PaddedImageView() override = default;
};
Expand Down
5 changes: 2 additions & 3 deletions browser/ui/views/brave_ads/text_notification_ad_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ class TextNotificationAdView : public NotificationAdView {
TextNotificationAdView(const TextNotificationAdView&) = delete;
TextNotificationAdView& operator=(const TextNotificationAdView&) = delete;

TextNotificationAdView(TextNotificationAdView&& other) noexcept = delete;
TextNotificationAdView& operator=(TextNotificationAdView&& other) noexcept =
delete;
TextNotificationAdView(TextNotificationAdView&&) noexcept = delete;
TextNotificationAdView& operator=(TextNotificationAdView&&) noexcept = delete;

~TextNotificationAdView() override;

Expand Down
2 changes: 2 additions & 0 deletions components/brave_ads/browser/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ source_set("browser") {
"component_updater/resource_info.h",
"frequency_capping_helper.cc",
"frequency_capping_helper.h",
"reminder_util.cc",
"reminder_util.h",
]

configs += [ "//build/config/compiler:wexit_time_destructors" ]
Expand Down
4 changes: 2 additions & 2 deletions components/brave_ads/browser/ads_service.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ class AdsService : public KeyedService {
AdsService(const AdsService&) = delete;
AdsService& operator=(const AdsService&) = delete;

AdsService(AdsService&& other) noexcept = delete;
AdsService& operator=(AdsService&& other) noexcept = delete;
AdsService(AdsService&&) noexcept = delete;
AdsService& operator=(AdsService&&) noexcept = delete;

~AdsService() override;

Expand Down
Loading