Merge pull request #165 from felixrieseberg/windows-7

Ensure Notifications are Windows 8+ Only
This commit is contained in:
Cheng Zhao 2015-11-10 16:19:05 +08:00
commit e3bcb15b81

View file

@ -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();
}