diff --git a/browser/ui/BUILD.gn b/browser/ui/BUILD.gn index b749cac896a..507b2724b3a 100644 --- a/browser/ui/BUILD.gn +++ b/browser/ui/BUILD.gn @@ -37,6 +37,7 @@ source_set("favicon_source") { source_set("ui") { # Remove when https://github.com/brave/brave-browser/issues/10614 is resolved check_includes = false + public_deps = [] sources = [ "webui/brave_adblock_ui.cc", "webui/brave_adblock_ui.h", @@ -150,6 +151,8 @@ source_set("ui") { "webui/settings/brave_relaunch_handler_mac.mm", ] } + + public_deps += [ "//brave/vendor/bat-native-ads" ] } # !is_android if (toolkit_views) { diff --git a/browser/ui/webui/brave_webui_source.cc b/browser/ui/webui/brave_webui_source.cc index 3b611d89403..38bc4861343 100644 --- a/browser/ui/webui/brave_webui_source.cc +++ b/browser/ui/webui/brave_webui_source.cc @@ -274,6 +274,8 @@ void CustomizeWebUIHTMLSource(const std::string &name, { "rewardsTokenBalance", IDS_REWARDS_WIDGET_TOKEN_BALANCE }, { "rewardsTokenGrantTitle", IDS_REWARDS_WIDGET_TOKEN_GRANT_TITLE }, { "rewardsWidgetBraveRewards", IDS_BRAVE_UI_BRAVE_REWARDS }, + { "rewardsBrowserCannotReceiveAds", IDS_REWARDS_BROWSER_CANNOT_RECEIVE_ADS }, // NOLINT + { "rewardsBrowserNeedsUpdateToSeeAds", IDS_REWARDS_BROWSER_NEEDS_UPDATE_TO_SEE_ADS }, // NOLINT // Brave Talk Widget { "braveTalkWidgetTitle", IDS_BRAVE_TALK_WIDGET_TITLE }, @@ -552,7 +554,7 @@ void CustomizeWebUIHTMLSource(const std::string &name, { "view", IDS_BRAVE_REWARDS_LOCAL_ADS_CONFIRMATION_TYPE_VIEW }, { "rewardsBrowserCannotReceiveAds", IDS_REWARDS_BROWSER_CANNOT_RECEIVE_ADS }, // NOLINT - { "rewardsBrowserNeedsUpdateToSeeAds", IDS_REWARDS_BROWSER_NEED_UPDATE_TO_SEE_ADS }, // NOLINT + { "rewardsBrowserNeedsUpdateToSeeAds", IDS_REWARDS_BROWSER_NEEDS_UPDATE_TO_SEE_ADS }, // NOLINT { "activityCopy", IDS_BRAVE_UI_ACTIVITY_COPY }, { "activityNote", IDS_BRAVE_UI_ACTIVITY_NOTE }, diff --git a/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.cc b/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.cc index 2519ee71840..d0aabb34182 100644 --- a/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.cc +++ b/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.cc @@ -21,7 +21,6 @@ #include "brave/browser/search_engines/search_engine_provider_util.h" #include "brave/browser/ui/webui/new_tab_page/brave_new_tab_ui.h" #include "brave/common/pref_names.h" -#include "brave/components/brave_ads/browser/ads_service.h" #include "brave/components/brave_perf_predictor/common/pref_names.h" #include "brave/components/brave_today/common/pref_names.h" #include "brave/components/crypto_dot_com/browser/buildflags/buildflags.h" @@ -145,6 +144,8 @@ enum class NTPCustomizeUsage { kNeverOpened, kOpened, kOpenedAndEdited, kSize }; const char kNTPCustomizeUsageStatus[] = "brave.new_tab_page.customize_p3a_usage"; +const char kNeedsBrowserUpdateToSeeAds[] = "needsBrowserUpdateToSeeAds"; + } // namespace // static @@ -176,6 +177,7 @@ bool BraveNewTabMessageHandler::CanPromptBraveTalk(base::Time now) { return (time_first_run <= talk_prompt_trigger_time); } +// static BraveNewTabMessageHandler* BraveNewTabMessageHandler::Create( content::WebUIDataSource* source, Profile* profile) { @@ -183,19 +185,19 @@ BraveNewTabMessageHandler* BraveNewTabMessageHandler::Create( // Initial Values // Should only contain data that is static // - auto* ads_service_ = brave_ads::AdsServiceFactory::GetForProfile(profile); + auto* ads_service = brave_ads::AdsServiceFactory::GetForProfile(profile); // For safety, default |is_ads_supported_locale_| to true. Better to have // false positive than falsen egative, // in which case we would not show "opt out" toggle. - bool is_ads_supported_locale_ = true; - if (!ads_service_) { + bool is_ads_supported_locale = true; + if (!ads_service) { LOG(ERROR) << "Ads service is not initialized!"; } else { - is_ads_supported_locale_ = ads_service_->IsSupportedLocale(); + is_ads_supported_locale = ads_service->IsSupportedLocale(); } source->AddBoolean("featureFlagBraveNTPSponsoredImagesWallpaper", - is_ads_supported_locale_); + is_ads_supported_locale); source->AddBoolean("braveTalkPromptAllowed", BraveNewTabMessageHandler::CanPromptBraveTalk()); @@ -209,6 +211,7 @@ BraveNewTabMessageHandler* BraveNewTabMessageHandler::Create( BraveNewTabMessageHandler::BraveNewTabMessageHandler(Profile* profile) : profile_(profile), weak_ptr_factory_(this) { + ads_service_ = brave_ads::AdsServiceFactory::GetForProfile(profile_); #if BUILDFLAG(ENABLE_TOR) tor_launcher_factory_ = TorLauncherFactory::GetInstance(); #endif @@ -245,6 +248,10 @@ void BraveNewTabMessageHandler::RegisterMessages() { "getNewTabPageTorProperties", base::BindRepeating(&BraveNewTabMessageHandler::HandleGetTorProperties, base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "getNewTabAdsData", + base::BindRepeating(&BraveNewTabMessageHandler::HandleGetNewTabAdsData, + base::Unretained(this))); web_ui()->RegisterMessageCallback( "toggleAlternativePrivateSearchEngine", base::BindRepeating(&BraveNewTabMessageHandler:: @@ -384,6 +391,11 @@ void BraveNewTabMessageHandler::OnJavascriptAllowed() { if (tor_launcher_factory_) tor_launcher_factory_->AddObserver(this); #endif + + if (ads_service_) { + ads_service_observation_.Reset(); + ads_service_observation_.Observe(ads_service_); + } } void BraveNewTabMessageHandler::OnJavascriptDisallowed() { @@ -392,6 +404,7 @@ void BraveNewTabMessageHandler::OnJavascriptDisallowed() { if (tor_launcher_factory_) tor_launcher_factory_->RemoveObserver(this); #endif + ads_service_observation_.Reset(); weak_ptr_factory_.InvalidateWeakPtrs(); } @@ -431,6 +444,18 @@ void BraveNewTabMessageHandler::HandleGetTorProperties( ResolveJavascriptCallback(args[0], data); } +void BraveNewTabMessageHandler::HandleGetNewTabAdsData( + const base::Value::List& args) { + if (!ads_service_) { + return; + } + + AllowJavascript(); + + base::Value data = GetAdsDataDictionary(); + ResolveJavascriptCallback(args[0], data); +} + void BraveNewTabMessageHandler::HandleToggleAlternativeSearchEngineProvider( const base::Value::List& args) { brave::ToggleUseAlternativeSearchEngineProvider(profile_); @@ -617,6 +642,19 @@ void BraveNewTabMessageHandler::OnPreferencesChanged() { FireWebUIListener("preferences-changed", data); } +base::Value BraveNewTabMessageHandler::GetAdsDataDictionary() const { + base::Value::Dict ads_data; + + bool needs_browser_update_to_see_ads = false; + if (ads_service_) { + needs_browser_update_to_see_ads = + ads_service_->NeedsBrowserUpdateToSeeAds(); + } + ads_data.Set(kNeedsBrowserUpdateToSeeAds, needs_browser_update_to_see_ads); + + return base::Value(std::move(ads_data)); +} + void BraveNewTabMessageHandler::OnTorCircuitEstablished(bool result) { auto data = GetTorPropertiesDictionary(result, ""); FireWebUIListener("tor-tab-data-updated", data); @@ -627,3 +665,8 @@ void BraveNewTabMessageHandler::OnTorInitializing( auto data = GetTorPropertiesDictionary(false, percentage); FireWebUIListener("tor-tab-data-updated", data); } + +void BraveNewTabMessageHandler::OnNeedsBrowserUpdateToSeeAds() { + base::Value data = GetAdsDataDictionary(); + FireWebUIListener("new-tab-ads-data-updated", data); +} diff --git a/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.h b/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.h index 28aed6d24ca..633eda6cffa 100644 --- a/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.h +++ b/browser/ui/webui/new_tab_page/brave_new_tab_message_handler.h @@ -10,6 +10,8 @@ #include "base/memory/raw_ptr.h" #include "base/memory/weak_ptr.h" +#include "base/scoped_observation.h" +#include "brave/components/brave_ads/browser/ads_service.h" #include "brave/components/tor/buildflags/buildflags.h" #include "brave/components/tor/tor_launcher_observer.h" #include "components/prefs/pref_change_registrar.h" @@ -19,6 +21,7 @@ class Profile; namespace base { class Time; +class Value; } // namespace base namespace content { @@ -35,7 +38,8 @@ class PrefService; // TODO(simonhong): Migrate to brave_new_tab_page.mojom. // Handles messages to and from the New Tab Page javascript class BraveNewTabMessageHandler : public content::WebUIMessageHandler, - public TorLauncherObserver { + public TorLauncherObserver, + public brave_ads::AdsServiceObserver { public: explicit BraveNewTabMessageHandler(Profile* profile); BraveNewTabMessageHandler(const BraveNewTabMessageHandler&) = delete; @@ -61,6 +65,7 @@ class BraveNewTabMessageHandler : public content::WebUIMessageHandler, void HandleGetStats(const base::Value::List& args); void HandleGetPrivateProperties(const base::Value::List& args); void HandleGetTorProperties(const base::Value::List& args); + void HandleGetNewTabAdsData(const base::Value::List& args); void HandleSaveNewTabPagePref(const base::Value::List& args); void HandleToggleAlternativeSearchEngineProvider( const base::Value::List& args); @@ -73,16 +78,26 @@ class BraveNewTabMessageHandler : public content::WebUIMessageHandler, void OnPreferencesChanged(); void OnPrivatePropertiesChanged(); + base::Value GetAdsDataDictionary() const; + // TorLauncherObserver: void OnTorCircuitEstablished(bool result) override; void OnTorInitializing(const std::string& percentage) override; + // brave_ads::AdsServiceObserver: + void OnNeedsBrowserUpdateToSeeAds() override; + PrefChangeRegistrar pref_change_registrar_; // Weak pointer. raw_ptr profile_ = nullptr; + raw_ptr ads_service_ = nullptr; #if BUILDFLAG(ENABLE_TOR) TorLauncherFactory* tor_launcher_factory_ = nullptr; #endif + + base::ScopedObservation + ads_service_observation_{this}; + base::WeakPtrFactory weak_ptr_factory_; }; diff --git a/components/brave_new_tab_ui/actions/new_tab_actions.ts b/components/brave_new_tab_ui/actions/new_tab_actions.ts index 76d5f11572a..c32c5be3800 100644 --- a/components/brave_new_tab_ui/actions/new_tab_actions.ts +++ b/components/brave_new_tab_ui/actions/new_tab_actions.ts @@ -11,6 +11,7 @@ import { types } from '../constants/new_tab_types' import { Stats } from '../api/stats' import { PrivateTabData } from '../api/privateTabData' import { TorTabData } from '../api/torTabData' +import { NewTabAdsData } from '../api/newTabAdsData' import { InitialData } from '../api/initialData' import { CustomBackground } from '../api/background' @@ -32,6 +33,9 @@ export const privateTabDataUpdated = (data: PrivateTabData) => export const torTabDataUpdated = (data: TorTabData) => action(types.NEW_TAB_TOR_TAB_DATA_UPDATED, data) +export const newTabAdsDataUpdated = (data: NewTabAdsData) => + action(types.NEW_TAB_ADS_DATA_UPDATED, data) + export const dismissBrandedWallpaperNotification = (isUserAction: boolean) => action(types.NEW_TAB_DISMISS_BRANDED_WALLPAPER_NOTIFICATION, { isUserAction diff --git a/components/brave_new_tab_ui/api/initialData.ts b/components/brave_new_tab_ui/api/initialData.ts index b61b9e5d380..72687dbeea7 100644 --- a/components/brave_new_tab_ui/api/initialData.ts +++ b/components/brave_new_tab_ui/api/initialData.ts @@ -8,6 +8,7 @@ import * as statsAPI from './stats' import * as privateTabDataAPI from './privateTabData' import * as torTabDataAPI from './torTabData' import * as wallpaper from './wallpaper' +import * as newTabAdsDataAPI from './newTabAdsData' export type InitialData = { preferences: NewTab.Preferences @@ -26,6 +27,7 @@ export type PreInitialRewardsData = { rewardsEnabled: boolean enabledAds: boolean adsSupported: boolean + needsBrowserUpdateToSeeAds: boolean } export type InitialRewardsData = { @@ -110,19 +112,28 @@ export async function getInitialData (): Promise { } export async function getRewardsPreInitialData (): Promise { - const [rewardsEnabled, enabledAds, adsSupported] = await Promise.all([ + const [ + rewardsEnabled, + enabledAds, + adsSupported, + adsData + ] = await Promise.all([ new Promise( (resolve) => chrome.braveRewards.getRewardsEnabled(resolve)), new Promise( (resolve) => chrome.braveRewards.getAdsEnabled(resolve)), new Promise( - (resolve) => chrome.braveRewards.getAdsSupported(resolve)) - ]) + (resolve) => chrome.braveRewards.getAdsSupported(resolve)), + newTabAdsDataAPI.getNewTabAdsData() + ]) + + const needsBrowserUpdateToSeeAds = adsData.needsBrowserUpdateToSeeAds return { rewardsEnabled, enabledAds, - adsSupported + adsSupported, + needsBrowserUpdateToSeeAds } } diff --git a/components/brave_new_tab_ui/api/newTabAdsData.ts b/components/brave_new_tab_ui/api/newTabAdsData.ts new file mode 100644 index 00000000000..a562c4eafe0 --- /dev/null +++ b/components/brave_new_tab_ui/api/newTabAdsData.ts @@ -0,0 +1,20 @@ +// Copyright (c) 2022 The Brave Authors. All rights reserved. +// This Source Code Form is subject to the terms of the Mozilla Public +// License, v. 2.0. If a copy of the MPL was not distributed with this file, +// you can obtain one at http://mozilla.org/MPL/2.0/. + +import * as Cr from 'chrome://resources/js/cr.m' + +export type NewTabAdsData = { + needsBrowserUpdateToSeeAds: boolean +} + +type NewTabAdsDataUpdatedHandler = (data: NewTabAdsData) => void + +export function getNewTabAdsData (): Promise { + return Cr.sendWithPromise('getNewTabAdsData') +} + +export function addChangeListener (listener: NewTabAdsDataUpdatedHandler): void { + Cr.addWebUIListener('new-tab-ads-data-updated', listener) +} diff --git a/components/brave_new_tab_ui/apiEventsToStore.ts b/components/brave_new_tab_ui/apiEventsToStore.ts index aa77ed239c3..9af0443f6a2 100644 --- a/components/brave_new_tab_ui/apiEventsToStore.ts +++ b/components/brave_new_tab_ui/apiEventsToStore.ts @@ -9,6 +9,7 @@ import * as statsAPI from './api/stats' import * as topSitesAPI from './api/topSites' import * as privateTabDataAPI from './api/privateTabData' import * as torTabDataAPI from './api/torTabData' +import * as newTabAdsDataAPI from './api/newTabAdsData' import getNTPBrowserAPI, { CustomBackground } from './api/background' import { getInitialData, getRewardsInitialData, getRewardsPreInitialData } from './api/initialData' @@ -28,6 +29,10 @@ async function updateTorTabData (data: torTabDataAPI.TorTabData) { getActions().torTabDataUpdated(data) } +async function updateNewTabAdsData (data: newTabAdsDataAPI.NewTabAdsData) { + getActions().newTabAdsDataUpdated(data) +} + function onRewardsToggled (prefData: NewTab.Preferences): void { if (prefData.showRewards) { rewardsInitData() @@ -61,6 +66,7 @@ export function wireApiEventsToStore () { preferencesAPI.addChangeListener(onRewardsToggled) privateTabDataAPI.addChangeListener(updatePrivateTabData) torTabDataAPI.addChangeListener(updateTorTabData) + newTabAdsDataAPI.addChangeListener(updateNewTabAdsData) getNTPBrowserAPI().addCustomBackgroundUpdatedListener(onCustomBackgroundUpdated) }) .catch(e => { diff --git a/components/brave_new_tab_ui/components/default/rewards/index.tsx b/components/brave_new_tab_ui/components/default/rewards/index.tsx index 9a8ef1bfb7e..e06af9d36d7 100644 --- a/components/brave_new_tab_ui/components/default/rewards/index.tsx +++ b/components/brave_new_tab_ui/components/default/rewards/index.tsx @@ -45,6 +45,7 @@ export function RewardsContextAdapter (props: { children: React.ReactNode }) { export interface RewardsProps { rewardsEnabled: boolean enabledAds: boolean + needsBrowserUpdateToSeeAds: boolean balance: NewTab.RewardsBalance externalWallet?: RewardsExtension.ExternalWallet report?: NewTab.RewardsBalanceReport @@ -103,6 +104,7 @@ export const RewardsWidget = createWidget((props: RewardsProps) => { rewardsEnabled={props.rewardsEnabled} adsEnabled={props.enabledAds} adsSupported={Boolean(props.adsSupported)} + needsBrowserUpdateToSeeAds={props.needsBrowserUpdateToSeeAds} rewardsBalance={props.balance.total} exchangeCurrency='USD' exchangeRate={props.parameters.rate} diff --git a/components/brave_new_tab_ui/constants/new_tab_types.ts b/components/brave_new_tab_ui/constants/new_tab_types.ts index b217068a9ca..c321ee410c7 100644 --- a/components/brave_new_tab_ui/constants/new_tab_types.ts +++ b/components/brave_new_tab_ui/constants/new_tab_types.ts @@ -16,6 +16,7 @@ export const enum types { NEW_TAB_STATS_UPDATED = '@@newtab/NEW_TAB_STATS_UPDATED', NEW_TAB_PRIVATE_TAB_DATA_UPDATED = '@@newtab/NEW_TAB_PRIVATE_TAB_DATA_UPDATED', NEW_TAB_TOR_TAB_DATA_UPDATED = '@@newtab/NEW_TAB_TOR_TAB_DATA_UPDATED', + NEW_TAB_ADS_DATA_UPDATED = '@@newtab/NEW_TAB_ADS_DATA_UPDATED', NEW_TAB_PREFERENCES_UPDATED = '@@newtab/NEW_TAB_PREFERENCES_UPDATED', NEW_TAB_DISMISS_BRANDED_WALLPAPER_NOTIFICATION = '@@newtab/NEW_TAB_DISMISS_BRANDED_WALLPAPER_NOTIFICATION', NEW_TAB_SET_INITIAL_DATA = '@@newtab/NEW_TAB_SET_INITIAL_DATA', diff --git a/components/brave_new_tab_ui/reducers/new_tab_reducer.ts b/components/brave_new_tab_ui/reducers/new_tab_reducer.ts index d47ba68be7b..126e0c11ef1 100644 --- a/components/brave_new_tab_ui/reducers/new_tab_reducer.ts +++ b/components/brave_new_tab_ui/reducers/new_tab_reducer.ts @@ -22,6 +22,7 @@ import { setMostVisitedSettings } from '../api/topSites' // Utils import { handleWidgetPrefsChange } from './stack_widget_reducer' +import { NewTabAdsData } from '../api/newTabAdsData' let sideEffectState: NewTab.State = storage.load() @@ -137,6 +138,11 @@ export const newTabReducer: Reducer = (state: NewTab.S } break + case types.NEW_TAB_ADS_DATA_UPDATED: + const newTabAdsData = payload as NewTabAdsData + state.rewardsState.needsBrowserUpdateToSeeAds = newTabAdsData.needsBrowserUpdateToSeeAds + break + case types.NEW_TAB_DISMISS_BRANDED_WALLPAPER_NOTIFICATION: const { isUserAction } = payload as DismissBrandedWallpaperNotificationPayload // Save persisted data. diff --git a/components/brave_new_tab_ui/reducers/rewards_reducer.ts b/components/brave_new_tab_ui/reducers/rewards_reducer.ts index cceed50e061..1c4cb5edbba 100644 --- a/components/brave_new_tab_ui/reducers/rewards_reducer.ts +++ b/components/brave_new_tab_ui/reducers/rewards_reducer.ts @@ -87,7 +87,8 @@ const rewardsReducer: Reducer = (state: NewTab.State, ...state.rewardsState, rewardsEnabled: preInitialRewardsDataPayload.rewardsEnabled, enabledAds: preInitialRewardsDataPayload.enabledAds, - adsSupported: preInitialRewardsDataPayload.adsSupported + adsSupported: preInitialRewardsDataPayload.adsSupported, + needsBrowserUpdateToSeeAds: preInitialRewardsDataPayload.needsBrowserUpdateToSeeAds } } break diff --git a/components/brave_new_tab_ui/storage/new_tab_storage.ts b/components/brave_new_tab_ui/storage/new_tab_storage.ts index ff9102c132e..28c5bd0b6a4 100644 --- a/components/brave_new_tab_ui/storage/new_tab_storage.ts +++ b/components/brave_new_tab_ui/storage/new_tab_storage.ts @@ -74,6 +74,7 @@ export const defaultState: NewTab.State = { dismissedNotifications: [], rewardsEnabled: false, enabledAds: false, + needsBrowserUpdateToSeeAds: false, adsSupported: false, promotions: [], totalContribution: 0.0, diff --git a/components/brave_rewards/resources/shared/components/newtab/rewards_card.style.ts b/components/brave_rewards/resources/shared/components/newtab/rewards_card.style.ts index fbb40aaf054..848bc52a9f9 100644 --- a/components/brave_rewards/resources/shared/components/newtab/rewards_card.style.ts +++ b/components/brave_rewards/resources/shared/components/newtab/rewards_card.style.ts @@ -182,6 +182,28 @@ export const pendingRewards = styled.div` } ` +export const needsBrowserUpdateView = styled.div` + display: block; + align-items: center; + justify-content: start; + background: #FDF1F2; + padding: 5px; + border-radius: 6px; +` + +export const needsBrowserUpdateContentHeader = styled.div` + margin: 5px; + font-size: 13px; + font-weight: 600; + color: var(--brave-palette-neutral800); +` + +export const needsBrowserUpdateContentBody = styled.div` + margin: 5px; + font-size: 13px; + color: var(--brave-palette-neutral800); +` + export const progressHeader = styled.div` margin-top: 16px; display: flex; diff --git a/components/brave_rewards/resources/shared/components/newtab/rewards_card.tsx b/components/brave_rewards/resources/shared/components/newtab/rewards_card.tsx index 91d35da7da6..e8f73293f34 100644 --- a/components/brave_rewards/resources/shared/components/newtab/rewards_card.tsx +++ b/components/brave_rewards/resources/shared/components/newtab/rewards_card.tsx @@ -64,6 +64,7 @@ interface Props { rewardsEnabled: boolean adsEnabled: boolean adsSupported: boolean + needsBrowserUpdateToSeeAds: boolean rewardsBalance: number exchangeRate: number exchangeCurrency: string @@ -118,6 +119,28 @@ export function RewardsCard (props: Props) { ) } + if (props.needsBrowserUpdateToSeeAds && props.adsSupported) { + return ( + + + + {getString('rewardsBrowserCannotReceiveAds')} + + + {getString('rewardsBrowserNeedsUpdateToSeeAds')} + + + + + + + ) + } + const showPending = shouldRenderPendingRewards( props.earningsLastMonth, props.nextPaymentDate) diff --git a/components/brave_rewards/resources/shared/components/newtab/stories/index.tsx b/components/brave_rewards/resources/shared/components/newtab/stories/index.tsx index c6e600936b5..ce09e7b665c 100644 --- a/components/brave_rewards/resources/shared/components/newtab/stories/index.tsx +++ b/components/brave_rewards/resources/shared/components/newtab/stories/index.tsx @@ -41,6 +41,7 @@ export function Card () { rewardsEnabled={true} adsEnabled={true} adsSupported={true} + needsBrowserUpdateToSeeAds={false} rewardsBalance={91.5812} exchangeCurrency='USD' exchangeRate={0.82} diff --git a/components/definitions/newTab.d.ts b/components/definitions/newTab.d.ts index 56120df1701..4c3f280101b 100644 --- a/components/definitions/newTab.d.ts +++ b/components/definitions/newTab.d.ts @@ -156,6 +156,7 @@ declare namespace NewTab { adsAccountStatement: AdsAccountStatement dismissedNotifications: string[] enabledAds: boolean + needsBrowserUpdateToSeeAds: boolean promotions: Promotion[] parameters: RewardsParameters totalContribution: number diff --git a/components/resources/brave_components_strings.grd b/components/resources/brave_components_strings.grd index 7b8172010bb..3b4daed3e7d 100644 --- a/components/resources/brave_components_strings.grd +++ b/components/resources/brave_components_strings.grd @@ -534,7 +534,7 @@ Oops! Your browser cannot receive Brave Private Ads. - Your browser needs to be updated to continue seeing ads. + Your browser needs to be updated to continue seeing ads. Ads not initialized, please refresh the page.