mirror of
https://github.com/electron/electron.git
synced 2026-01-27 16:28:23 -05:00
Ensure Notifications are Windows 8 and up only
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user