Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2463)

Unified Diff: chrome/browser/notifications/notification_display_service_factory.cc

Issue 2033093003: [Notification] Make HTML5 Notification use ActionCenter on Windows 10, behind Flags. Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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());

Powered by Google App Engine
This is Rietveld 408576698