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

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

Issue 2836093002: Make Android notifications rely on the native notification flag (Closed)
Patch Set: Add an additional check for Android Created 3 years, 8 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 3e7c4f17533e5000c53c894bbd2a78fa6578b7cd..da0e659dca9a5d29a057b5da66bde7ceaf6a3531 100644
--- a/chrome/browser/notifications/notification_display_service_factory.cc
+++ b/chrome/browser/notifications/notification_display_service_factory.cc
@@ -39,25 +39,28 @@ NotificationDisplayServiceFactory::NotificationDisplayServiceFactory()
// Selection of the implementation works as follows:
// - Android always uses the NativeNotificationDisplayService.
-// - Mac uses the MessageCenterDisplayService by default, but can use the
-// NativeNotificationDisplayService by using the chrome://flags or via
-// the --enable-features=NativeNotifications command line flag.
+// - Mac uses the NativeNotificationDisplayService by default but
+// can revert to MessageCenterDisplayService via
+// chrome://flags#enable-native-notifications or Finch
+// - Linux uses 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)
+ DCHECK(base::FeatureList::IsEnabled(features::kNativeNotifications));
return new NativeNotificationDisplayService(
Profile::FromBrowserContext(context),
g_browser_process->notification_platform_bridge());
-#else // defined(OS_ANDROID)
+#endif
if (base::FeatureList::IsEnabled(features::kNativeNotifications) &&
g_browser_process->notification_platform_bridge()) {
return new NativeNotificationDisplayService(
Profile::FromBrowserContext(context),
g_browser_process->notification_platform_bridge());
}
-#endif // defined(OS_ANDROID)
#endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
return new MessageCenterDisplayService(
Profile::FromBrowserContext(context),

Powered by Google App Engine
This is Rietveld 408576698