2015-12-25 02:16:07 +00:00
|
|
|
// Copyright (c) 2015 GitHub, Inc.
|
|
|
|
// Use of this source code is governed by the MIT license that can be
|
|
|
|
// found in the LICENSE file.
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#ifndef BRIGHTRAY_BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_
|
|
|
|
#define BRIGHTRAY_BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_
|
2015-12-25 02:16:07 +00:00
|
|
|
|
2016-05-23 01:59:07 +00:00
|
|
|
#include <memory>
|
|
|
|
|
|
|
|
#include "base/macros.h"
|
2015-12-25 02:16:07 +00:00
|
|
|
#include "browser/notification_delegate.h"
|
|
|
|
|
|
|
|
namespace brightray {
|
|
|
|
|
|
|
|
// Adapt the content::DesktopNotificationDelegate to NotificationDelegate.
|
|
|
|
class NotificationDelegateAdapter : public NotificationDelegate {
|
|
|
|
public:
|
|
|
|
explicit NotificationDelegateAdapter(
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<content::DesktopNotificationDelegate> delegate);
|
2015-12-25 02:16:07 +00:00
|
|
|
~NotificationDelegateAdapter() override;
|
|
|
|
|
|
|
|
// NotificationDelegate:
|
|
|
|
void NotificationDestroyed() override;
|
|
|
|
|
|
|
|
// content::DesktopNotificationDelegate:
|
|
|
|
void NotificationDisplayed() override;
|
|
|
|
void NotificationClosed() override;
|
|
|
|
void NotificationClick() override;
|
|
|
|
|
|
|
|
private:
|
2016-05-23 01:59:07 +00:00
|
|
|
std::unique_ptr<content::DesktopNotificationDelegate> delegate_;
|
2015-12-25 02:16:07 +00:00
|
|
|
|
|
|
|
DISALLOW_COPY_AND_ASSIGN(NotificationDelegateAdapter);
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace brightray
|
|
|
|
|
2017-05-18 22:05:25 +00:00
|
|
|
#endif // BRIGHTRAY_BROWSER_NOTIFICATION_DELEGATE_ADAPTER_H_
|