From 995b09485896ad4bef26cf272fc0fbdc0a415614 Mon Sep 17 00:00:00 2001 From: Felix Rieseberg Date: Mon, 9 Nov 2015 09:51:52 -0800 Subject: [PATCH] Ensure Notifications are Windows 8 and up only --- .../browser/platform_notification_service_impl.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/brightray/browser/platform_notification_service_impl.cc b/brightray/browser/platform_notification_service_impl.cc index db8572ee8987..36045f6db4f2 100644 --- a/brightray/browser/platform_notification_service_impl.cc +++ b/brightray/browser/platform_notification_service_impl.cc @@ -8,6 +8,10 @@ #include "content/public/browser/desktop_notification_delegate.h" +#if defined(OS_WIN) +#include "base/win/windows_version.h" +#endif + namespace brightray { // static @@ -20,8 +24,16 @@ PlatformNotificationServiceImpl::PlatformNotificationServiceImpl() {} PlatformNotificationServiceImpl::~PlatformNotificationServiceImpl() {} NotificationPresenter* PlatformNotificationServiceImpl::notification_presenter() { - if (!notification_presenter_) + if (!notification_presenter_) { + #if defined(OS_WIN) + // Bail out if on Windows 7 or even lower, no operating will follow + if (base::win::GetVersion() < base::win::VERSION_WIN8) { + return notification_presenter_.get(); + } + #endif + // Create a new presenter if on OS X, Linux, or Windows 8+ notification_presenter_.reset(NotificationPresenter::Create()); + } return notification_presenter_.get(); }