diff --git a/brightray/brightray.gyp b/brightray/brightray.gyp index 052f04863cdd..a00cfa0d3dcb 100644 --- a/brightray/brightray.gyp +++ b/brightray/brightray.gyp @@ -42,8 +42,8 @@ 'browser/mac/bry_inspectable_web_contents_view_private.h', 'browser/network_delegate.cc', 'browser/network_delegate.h', - 'browser/notification_presenter.cc', 'browser/notification_presenter.h', + 'browser/notification_presenter_mac.h', 'browser/notification_presenter_mac.mm', 'browser/url_request_context_getter.cc', 'browser/url_request_context_getter.h', diff --git a/brightray/browser/browser_client.cc b/brightray/browser/browser_client.cc index 7c6aa89381a9..63fb78257bf3 100644 --- a/brightray/browser/browser_client.cc +++ b/brightray/browser/browser_client.cc @@ -22,7 +22,7 @@ BrowserContext* BrowserClient::browser_context() { NotificationPresenter* BrowserClient::notification_presenter() { if (!notification_presenter_) - notification_presenter_.reset(new NotificationPresenter); + notification_presenter_.reset(NotificationPresenter::Create()); return notification_presenter_.get(); } diff --git a/brightray/browser/notification_presenter.cc b/brightray/browser/notification_presenter.cc deleted file mode 100644 index 152a10c3b8af..000000000000 --- a/brightray/browser/notification_presenter.cc +++ /dev/null @@ -1,11 +0,0 @@ -#include "browser/notification_presenter.h" - -namespace brightray { - -NotificationPresenter::NotificationPresenter() { -} - -NotificationPresenter::~NotificationPresenter() { -} - -} diff --git a/brightray/browser/notification_presenter.h b/brightray/browser/notification_presenter.h index 1ef7e3d5cd00..f2b6e7ea44cf 100644 --- a/brightray/browser/notification_presenter.h +++ b/brightray/browser/notification_presenter.h @@ -9,13 +9,14 @@ namespace brightray { class NotificationPresenter { public: - NotificationPresenter(); - ~NotificationPresenter(); + virtual ~NotificationPresenter() {}; - void ShowNotification( + static NotificationPresenter* Create(); + + virtual void ShowNotification( const content::ShowDesktopNotificationHostMsgParams&, int render_process_id, - int render_view_id); + int render_view_id) = 0; }; } diff --git a/brightray/browser/notification_presenter_mac.h b/brightray/browser/notification_presenter_mac.h new file mode 100644 index 000000000000..3334c5f3c6b7 --- /dev/null +++ b/brightray/browser/notification_presenter_mac.h @@ -0,0 +1,23 @@ +#ifndef BRIGHTRAY_BROWSER_NOTIFICATION_PRESENTER_MAC_H_ +#define BRIGHTRAY_BROWSER_NOTIFICATION_PRESENTER_MAC_H_ + +#import "browser/notification_presenter.h" + +#import "base/compiler_specific.h" + +namespace brightray { + +class NotificationPresenterMac : public NotificationPresenter { + public: + NotificationPresenterMac(); + ~NotificationPresenterMac(); + + virtual void ShowNotification( + const content::ShowDesktopNotificationHostMsgParams&, + int render_process_id, + int render_view_id) OVERRIDE; +}; + +} + +#endif diff --git a/brightray/browser/notification_presenter_mac.mm b/brightray/browser/notification_presenter_mac.mm index b348d0c1bc0d..2b07ae906273 100644 --- a/brightray/browser/notification_presenter_mac.mm +++ b/brightray/browser/notification_presenter_mac.mm @@ -1,4 +1,4 @@ -#import "browser/notification_presenter.h" +#import "browser/notification_presenter_mac.h" #import "base/strings/sys_string_conversions.h" #import "content/public/browser/render_view_host.h" @@ -8,7 +8,17 @@ namespace brightray { -void NotificationPresenter::ShowNotification( +NotificationPresenter* NotificationPresenter::Create() { + return new NotificationPresenterMac; +} + +NotificationPresenterMac::NotificationPresenterMac() { +} + +NotificationPresenterMac::~NotificationPresenterMac() { +} + +void NotificationPresenterMac::ShowNotification( const content::ShowDesktopNotificationHostMsgParams& params, int render_process_id, int render_view_id) {