From b6fc1b82e8554dba7b3615ea37140e35baa31572 Mon Sep 17 00:00:00 2001 From: Terry Mancey Date: Thu, 24 Oct 2024 18:40:34 -0500 Subject: [PATCH] [ads] Add SmartNTT operating system condition matcher --- browser/brave_ads/ads_service_delegate.cc | 1 + .../serving/new_tab_page_ad_serving_condition_matcher_util.h | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/browser/brave_ads/ads_service_delegate.cc b/browser/brave_ads/ads_service_delegate.cc index b1a43c702aac..61115155b0ea 100644 --- a/browser/brave_ads/ads_service_delegate.cc +++ b/browser/brave_ads/ads_service_delegate.cc @@ -154,6 +154,7 @@ base::Value::Dict AdsServiceDelegate::GetVirtualPrefs() { } return base::Value::Dict() + .Set("[virtual]:operating_system.name", version_info::GetOSType()) .Set("[virtual]:build_channel.name", version_info::GetChannelString(chrome::GetChannel())) .Set("[virtual]:browser_version", version_info::GetVersionNumber()) diff --git a/components/brave_ads/core/public/serving/new_tab_page_ad_serving_condition_matcher_util.h b/components/brave_ads/core/public/serving/new_tab_page_ad_serving_condition_matcher_util.h index 450616655f97..574671c9a44f 100644 --- a/components/brave_ads/core/public/serving/new_tab_page_ad_serving_condition_matcher_util.h +++ b/components/brave_ads/core/public/serving/new_tab_page_ad_serving_condition_matcher_util.h @@ -111,6 +111,10 @@ class PrefProviderInterface; // profile or local state preferences. Virtual preference path keys should be // prefixed with "[virtual]:". // +// "[virtual]:operating_system.name" retrieves the operating system, returning +// one of the following values: "Windows", "Mac OS X", "Linux", "Android", +// "iOS", or "Unknown". +// // "[virtual]:build_channel.name" retrieves the build channel of the browser, // returning one of the following values: "stable", "beta", "dev", "nightly", or // "unknown".