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

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

Issue 2836093002: Make Android notifications rely on the native notification flag (Closed)
Patch Set: Update paths 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
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..6c04ae12d1219450796a84a562085799295e8058 100644
--- a/chrome/browser/notifications/notification_display_service_factory.cc
+++ b/chrome/browser/notifications/notification_display_service_factory.cc
@@ -39,25 +39,23 @@ 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)
- return new NativeNotificationDisplayService(
- Profile::FromBrowserContext(context),
- g_browser_process->notification_platform_bridge());
-#else // defined(OS_ANDROID)
+ // Note that for android this flag must always be true.
Peter Beverloo 2017/04/25 16:31:29 DCHECK?
Miguel Garcia 2017/05/03 07:11:33 As discussed offline in addition to the DCHECK I a
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),
« no previous file with comments | « no previous file | chrome/browser/notifications/platform_notification_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698