OLD | NEW |
(Empty) | |
| 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 |
| 10 #include "base/macros.h" |
| 11 #include "chrome/browser/notifications/notification_delegate.h" |
| 12 #include "url/gurl.h" |
| 13 |
| 14 namespace content { |
| 15 class BrowserContext; |
| 16 } |
| 17 |
| 18 // Base class for the PersistentNotificationDelegate and the |
| 19 // NotificationObjectProxy. All common functionality for displaying web |
| 20 // notifications is found here. |
| 21 // TODO(peter, crbug.com/596161): Migrate this functionality offered by the |
| 22 // delegate to the NotificationDisplayService. |
| 23 class WebNotificationDelegate : public NotificationDelegate { |
| 24 public: |
| 25 // NotificationDelegate implementation. |
| 26 std::string id() const override; |
| 27 void SettingsClick() override; |
| 28 bool ShouldDisplaySettingsButton() override; |
| 29 bool ShouldDisplayOverFullscreen() const override; |
| 30 |
| 31 protected: |
| 32 WebNotificationDelegate(content::BrowserContext* browser_context, |
| 33 const std::string& notification_id, |
| 34 const GURL& origin); |
| 35 |
| 36 ~WebNotificationDelegate() override; |
| 37 |
| 38 content::BrowserContext* browser_context() { return browser_context_; } |
| 39 const GURL& origin() { return origin_; } |
| 40 |
| 41 private: |
| 42 content::BrowserContext* browser_context_; |
| 43 std::string notification_id_; |
| 44 GURL origin_; |
| 45 |
| 46 DISALLOW_COPY_AND_ASSIGN(WebNotificationDelegate); |
| 47 }; |
| 48 |
| 49 #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
OLD | NEW |