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

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: Sync and merge. Created 3 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 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),
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/notifications/notification_platform_bridge_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698