Merge pull request #165 from felixrieseberg/windows-7
Ensure Notifications are Windows 8+ Only
This commit is contained in:
commit
e3bcb15b81
1 changed files with 13 additions and 1 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue