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

Hide Later button in adaptive captcha notification instead of disabli… #11016

Merged
merged 1 commit into from
Nov 12, 2021
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions browser/brave_ads/tooltips/ads_tooltips_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ AdsTooltipsController::~AdsTooltipsController() = default;
void AdsTooltipsController::ShowCaptchaTooltip(
const std::string& payment_id,
const std::string& captcha_id,
bool enable_cancel_button,
bool include_cancel_button,
ShowScheduledCaptchaCallback show_captcha_callback,
SnoozeScheduledCaptchaCallback snooze_captcha_callback) {
const std::u16string title = l10n_util::GetStringUTF16(
Expand All @@ -36,12 +36,13 @@ void AdsTooltipsController::ShowCaptchaTooltip(
IDS_BRAVE_ADS_SCHEDULED_CAPTCHA_NOTIFICATION_BODY);
const std::u16string ok_button_text = l10n_util::GetStringUTF16(
IDS_BRAVE_ADS_SCHEDULED_CAPTCHA_NOTIFICATION_OK_BUTTON_TEXT);
const std::u16string cancel_button_text = l10n_util::GetStringUTF16(
std::u16string cancel_button_text = l10n_util::GetStringUTF16(
IDS_BRAVE_ADS_SCHEDULED_CAPTCHA_NOTIFICATION_CANCEL_BUTTON_TEXT);

brave_tooltips::BraveTooltipAttributes tooltip_attributes(
title, body, ok_button_text, cancel_button_text);
tooltip_attributes.set_cancel_button_enabled(enable_cancel_button);
title, body, ok_button_text,
include_cancel_button ? cancel_button_text : u"");
tooltip_attributes.set_cancel_button_enabled(include_cancel_button);
auto captcha_tooltip = std::make_unique<AdsCaptchaTooltip>(
std::move(show_captcha_callback), std::move(snooze_captcha_callback),
tooltip_attributes, payment_id, captcha_id);
Expand Down
2 changes: 1 addition & 1 deletion browser/brave_ads/tooltips/ads_tooltips_controller.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AdsTooltipsController : public AdsTooltipsDelegate,
void ShowCaptchaTooltip(
const std::string& payment_id,
const std::string& captcha_id,
bool enable_cancel_button,
bool include_cancel_button,
ShowScheduledCaptchaCallback show_captcha_callback,
SnoozeScheduledCaptchaCallback snooze_captcha_callback) override;
void CloseCaptchaTooltip() override;
Expand Down
4 changes: 2 additions & 2 deletions browser/brave_ads/tooltips/ads_tooltips_delegate_impl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ AdsTooltipsDelegateImpl::AdsTooltipsDelegateImpl(Profile* profile)
void AdsTooltipsDelegateImpl::ShowCaptchaTooltip(
const std::string& payment_id,
const std::string& captcha_id,
bool enable_cancel_button,
bool include_cancel_button,
ShowScheduledCaptchaCallback show_captcha_callback,
SnoozeScheduledCaptchaCallback snooze_captcha_callback) {
ads_tooltips_controller_.ShowCaptchaTooltip(
payment_id, captcha_id, enable_cancel_button,
payment_id, captcha_id, include_cancel_button,
std::move(show_captcha_callback), std::move(snooze_captcha_callback));
}

Expand Down
2 changes: 1 addition & 1 deletion browser/brave_ads/tooltips/ads_tooltips_delegate_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class AdsTooltipsDelegateImpl : public AdsTooltipsDelegate {
void ShowCaptchaTooltip(
const std::string& payment_id,
const std::string& captcha_id,
bool enable_cancel_button,
bool include_cancel_button,
ShowScheduledCaptchaCallback show_captcha_callback,
SnoozeScheduledCaptchaCallback snooze_captcha_callback) override;
void CloseCaptchaTooltip() override;
Expand Down
2 changes: 1 addition & 1 deletion components/brave_ads/browser/ads_tooltips_delegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class AdsTooltipsDelegate {
virtual void ShowCaptchaTooltip(
const std::string& payment_id,
const std::string& captcha_id,
bool enable_cancel_button,
bool include_cancel_button,
ShowScheduledCaptchaCallback show_captcha_callback,
SnoozeScheduledCaptchaCallback snooze_captcha_callback) = 0;

Expand Down