Chromium Code Reviews| Index: chrome/browser/notifications/web_notification_delegate.h |
| diff --git a/chrome/browser/notifications/web_notification_delegate.h b/chrome/browser/notifications/web_notification_delegate.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..f2e178984579ff97ed824197b1a5e6c165414725 |
| --- /dev/null |
| +++ b/chrome/browser/notifications/web_notification_delegate.h |
| @@ -0,0 +1,45 @@ |
| +// Copyright 2016 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| +#define CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| + |
| +#include <string> |
| + |
| +#include "base/macros.h" |
| +#include "chrome/browser/notifications/notification_delegate.h" |
| +#include "url/gurl.h" |
| + |
| +namespace content { |
| +class BrowserContext; |
| +} |
| + |
| +// Base class for the PersistentNotificationDelegate and the |
| +// NotificationObjectProxy. All common functionality for displaying web |
| +// notifications is found here. |
|
Peter Beverloo
2016/09/27 17:17:37
nit: This may feel rather counter-intuitive today,
bmalcolm
2016/09/27 20:34:36
Done.
|
| +class WebNotificationDelegate : public NotificationDelegate { |
| + public: |
| + WebNotificationDelegate(content::BrowserContext* browser_context, |
|
Peter Beverloo
2016/09/27 17:17:37
nit: maybe make this protected too to avoid anyone
bmalcolm
2016/09/27 20:34:36
Done.
|
| + const std::string& notification_id, |
| + const GURL& origin); |
| + |
|
Peter Beverloo
2016/09/27 17:17:37
micro nit:
// NotificationDelegate implementation
bmalcolm
2016/09/27 20:34:36
Done.
|
| + std::string id() const override; |
| + void SettingsClick() override; |
| + bool ShouldDisplaySettingsButton() override; |
| + bool ShouldDisplayOverFullscreen() const override; |
| + |
| + protected: |
| + ~WebNotificationDelegate() override; |
| + |
| + content::BrowserContext* browser_context() { return browser_context_; } |
| + const GURL& origin() { return origin_; } |
| + |
| + private: |
| + content::BrowserContext* browser_context_; |
| + std::string notification_id_; |
| + GURL origin_; |
|
Peter Beverloo
2016/09/27 17:17:37
nit: DISALLOW_COPY_AND_ASSIGN(WebNotificationDeleg
bmalcolm
2016/09/27 20:34:36
Done.
|
| +}; |
| + |
| + |
| +#endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |