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

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

Issue 2794103002: Add initial support for native Linux desktop notifications (Closed)
Patch Set: Remove unused import 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 | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/notifications/notification_platform_bridge.h » ('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 8b40bcdab31544c9e5c7c2a0f2df89c79634622f..3e7c4f17533e5000c53c894bbd2a78fa6578b7cd 100644
--- a/chrome/browser/notifications/notification_display_service_factory.cc
+++ b/chrome/browser/notifications/notification_display_service_factory.cc
@@ -12,9 +12,10 @@
#include "chrome/browser/profiles/incognito_helpers.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/common/chrome_features.h"
+#include "chrome/common/features.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
-#if defined(OS_ANDROID) || defined(OS_MACOSX)
+#if BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
#include "chrome/browser/notifications/native_notification_display_service.h"
#endif
@@ -44,17 +45,20 @@ NotificationDisplayServiceFactory::NotificationDisplayServiceFactory()
// - 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());
-#elif defined(OS_MACOSX)
- if (base::FeatureList::IsEnabled(features::kNativeNotifications)) {
+#else // defined(OS_ANDROID)
+ 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
+#endif // defined(OS_ANDROID)
+#endif // BUILDFLAG(ENABLE_NATIVE_NOTIFICATIONS)
return new MessageCenterDisplayService(
Profile::FromBrowserContext(context),
g_browser_process->notification_ui_manager());
« no previous file with comments | « chrome/browser/browser_process_impl.cc ('k') | chrome/browser/notifications/notification_platform_bridge.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698