bmalcolm | f8395c56 | 2016-09-29 22:49:14 | [diff] [blame] | 1 | // Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| 6 | #define CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | |
bmalcolm | 989c7324 | 2016-10-10 17:42:45 | [diff] [blame] | 10 | #include "base/feature_list.h" |
bmalcolm | f8395c56 | 2016-09-29 22:49:14 | [diff] [blame] | 11 | #include "base/macros.h" |
| 12 | #include "chrome/browser/notifications/notification_delegate.h" |
| 13 | #include "url/gurl.h" |
| 14 | |
| 15 | namespace content { |
| 16 | class BrowserContext; |
| 17 | } |
| 18 | |
bmalcolm | 989c7324 | 2016-10-10 17:42:45 | [diff] [blame] | 19 | namespace features { |
| 20 | |
| 21 | extern const base::Feature kAllowFullscreenWebNotificationsFeature; |
| 22 | |
| 23 | } // namespace features |
| 24 | |
bmalcolm | f8395c56 | 2016-09-29 22:49:14 | [diff] [blame] | 25 | // Base class for the PersistentNotificationDelegate and the |
| 26 | // NotificationObjectProxy. All common functionality for displaying web |
| 27 | // notifications is found here. |
| 28 | // TODO(peter, crbug.com/596161): Migrate this functionality offered by the |
| 29 | // delegate to the NotificationDisplayService. |
| 30 | class WebNotificationDelegate : public NotificationDelegate { |
| 31 | public: |
| 32 | // NotificationDelegate implementation. |
| 33 | std::string id() const override; |
peter | 9b6e3c7 | 2017-04-10 18:35:45 | [diff] [blame^] | 34 | bool SettingsClick() override; |
bmalcolm | f8395c56 | 2016-09-29 22:49:14 | [diff] [blame] | 35 | bool ShouldDisplaySettingsButton() override; |
| 36 | bool ShouldDisplayOverFullscreen() const override; |
| 37 | |
| 38 | protected: |
| 39 | WebNotificationDelegate(content::BrowserContext* browser_context, |
| 40 | const std::string& notification_id, |
| 41 | const GURL& origin); |
| 42 | |
| 43 | ~WebNotificationDelegate() override; |
| 44 | |
| 45 | content::BrowserContext* browser_context() { return browser_context_; } |
| 46 | const GURL& origin() { return origin_; } |
| 47 | |
| 48 | private: |
| 49 | content::BrowserContext* browser_context_; |
| 50 | std::string notification_id_; |
| 51 | GURL origin_; |
| 52 | |
| 53 | DISALLOW_COPY_AND_ASSIGN(WebNotificationDelegate); |
| 54 | }; |
| 55 | |
| 56 | #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |