| 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 1caf65749acf520d5fbe9ae772912dd668d265b3..e46f288fdb7d6e8ad60ca5979475c3e1b66a63bd 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"
|
| @@ -14,7 +15,7 @@
|
| #include "chrome/common/chrome_switches.h"
|
| #include "components/keyed_service/content/browser_context_dependency_manager.h"
|
|
|
| -#if defined(OS_ANDROID) || defined(OS_MACOSX)
|
| +#if defined(OS_WIN) || defined(OS_ANDROID) || defined(OS_MACOSX)
|
| #include "chrome/browser/notifications/native_notification_display_service.h"
|
| #endif
|
|
|
| @@ -44,7 +45,15 @@ NotificationDisplayServiceFactory::NotificationDisplayServiceFactory()
|
| // - All other platforms always use the MessageCenterDisplayService.
|
| KeyedService* NotificationDisplayServiceFactory::BuildServiceInstanceFor(
|
| content::BrowserContext* context) const {
|
| -#if defined(OS_ANDROID)
|
| +#if defined(OS_WIN)
|
| + if (base::win::GetVersion() >= base::win::VERSION_WIN10 &&
|
| + base::CommandLine::ForCurrentProcess()->HasSwitch(
|
| + switches::kEnableNativeNotifications)) {
|
| + return new NativeNotificationDisplayService(
|
| + Profile::FromBrowserContext(context),
|
| + g_browser_process->notification_platform_bridge());
|
| + }
|
| +#elif defined(OS_ANDROID)
|
| return new NativeNotificationDisplayService(
|
| Profile::FromBrowserContext(context),
|
| g_browser_process->notification_platform_bridge());
|
|
|