Index: chrome/browser/notifications/notification_display_service_factory.cc |
diff --git a/chrome/browser/notifications/notification_display_service_factory.cc b/chrome/browser/notifications/notification_display_service_factory.cc |
index da0e659dca9a5d29a057b5da66bde7ceaf6a3531..8581780df076361b5125d74b98d4aad4fb8aa786 100644 |
--- a/chrome/browser/notifications/notification_display_service_factory.cc |
+++ b/chrome/browser/notifications/notification_display_service_factory.cc |
@@ -6,6 +6,7 @@ |
#include "base/command_line.h" |
#include "base/memory/singleton.h" |
+#include "base/win/windows_version.h" |
#include "chrome/browser/browser_process.h" |
#include "chrome/browser/notifications/message_center_display_service.h" |
#include "chrome/browser/notifications/notification_ui_manager.h" |
@@ -45,11 +46,22 @@ NotificationDisplayServiceFactory::NotificationDisplayServiceFactory() |
// - Linux uses MessageCenterDisplayService by default but can switch |
// to NativeNotificationDisplayService via |
// chrome://flags#enable-native-notifications |
+// - Windows 10 update 2016/07 and above use MessageCenterDisplayService by |
+// default but can switch to NativeNotificationDisplayService via |
+// chrome://flags#enable-native-notifications |
// - All other platforms always use the MessageCenterDisplayService. |
KeyedService* NotificationDisplayServiceFactory::BuildServiceInstanceFor( |
content::BrowserContext* context) const { |
#if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS) |
-#if defined(OS_ANDROID) |
+#if defined(OS_WIN) |
+ DCHECK(base::FeatureList::IsEnabled(features::kNativeNotifications)); |
+ if (base::win::GetVersion() >= base::win::VERSION_WIN10_R1 && |
+ base::FeatureList::IsEnabled(features::kNativeNotifications)) { |
+ return new NativeNotificationDisplayService( |
+ Profile::FromBrowserContext(context), |
+ g_browser_process->notification_platform_bridge()); |
+ } |
+#elif defined(OS_ANDROID) |
DCHECK(base::FeatureList::IsEnabled(features::kNativeNotifications)); |
return new NativeNotificationDisplayService( |
Profile::FromBrowserContext(context), |