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

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

Issue 2794103002: Add initial support for native Linux desktop notifications (Closed)
Patch Set: Rebase, address peter@'s comments 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 8b40bcdab31544c9e5c7c2a0f2df89c79634622f..a707dff78ca401ea1df79fad87aa5f91f23f0b15 100644
--- a/chrome/browser/notifications/notification_display_service_factory.cc
+++ b/chrome/browser/notifications/notification_display_service_factory.cc
@@ -14,7 +14,8 @@
#include "chrome/common/chrome_features.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#if defined(OS_ANDROID) || defined(OS_MACOSX)
+#if defined(OS_ANDROID) || defined(OS_MACOSX) || \
+ (defined(OS_LINUX) && !defined(OS_CHROMEOS))
Lei Zhang 2017/04/04 07:47:21 To make this even longer, do we need to gate this
Peter Beverloo 2017/04/04 13:34:46 It probably makes sense to use a BUILDFLAG for thi
Tom (Use chromium acct) 2017/04/04 21:47:10 Added the BUILDFLAG and made the condition depend
#include "chrome/browser/notifications/native_notification_display_service.h"
#endif
@@ -48,8 +49,9 @@ KeyedService* NotificationDisplayServiceFactory::BuildServiceInstanceFor(
return new NativeNotificationDisplayService(
Profile::FromBrowserContext(context),
g_browser_process->notification_platform_bridge());
-#elif defined(OS_MACOSX)
- if (base::FeatureList::IsEnabled(features::kNativeNotifications)) {
+#elif defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(OS_CHROMEOS))
+ if (base::FeatureList::IsEnabled(features::kNativeNotifications) &&
+ g_browser_process->notification_platform_bridge()) {
return new NativeNotificationDisplayService(
Profile::FromBrowserContext(context),
g_browser_process->notification_platform_bridge());

Powered by Google App Engine
This is Rietveld 408576698