Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/feature_list.h" | 10 #include "base/feature_list.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "chrome/browser/notifications/notification_common.h" | 12 #include "chrome/browser/notifications/notification_common.h" |
| 13 #include "chrome/browser/notifications/notification_delegate.h" | 13 #include "chrome/browser/notifications/notification_delegate.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 | 17 |
| 18 namespace features { | 18 namespace features { |
| 19 | 19 |
| 20 extern const base::Feature kAllowFullscreenWebNotificationsFeature; | 20 extern const base::Feature kAllowFullscreenWebNotificationsFeature; |
| 21 | 21 |
| 22 } // namespace features | 22 } // namespace features |
| 23 | 23 |
| 24 // Delegate class for Web Notifications. | 24 // Delegate class for Web Notifications. |
| 25 class WebNotificationDelegate : public NotificationDelegate { | 25 class WebNotificationDelegate : public NotificationDelegate { |
|
Peter Beverloo
2017/06/13 22:56:42
Eventually the Message Center display bridge will
Miguel Garcia
2017/06/14 09:39:38
Yes, at this point the only reason why we cannot c
| |
| 26 public: | 26 public: |
| 27 WebNotificationDelegate(NotificationCommon::Type notification_type, | 27 WebNotificationDelegate(NotificationCommon::Type notification_type, |
| 28 Profile* profile, | 28 Profile* profile, |
| 29 const std::string& notification_id, | 29 const std::string& notification_id, |
| 30 const GURL& origin); | 30 const GURL& origin); |
| 31 | 31 |
| 32 // NotificationDelegate implementation. | 32 // NotificationDelegate implementation. |
| 33 std::string id() const override; | 33 std::string id() const override; |
| 34 bool SettingsClick() override; | 34 bool SettingsClick() override; |
| 35 bool ShouldDisplaySettingsButton() override; | 35 bool ShouldDisplaySettingsButton() override; |
| 36 bool ShouldDisplayOverFullscreen() const override; | 36 bool ShouldDisplayOverFullscreen() const override; |
| 37 void Display() override; | |
| 38 void Close(bool by_user) override; | 37 void Close(bool by_user) override; |
| 39 void Click() override; | 38 void Click() override; |
| 40 void ButtonClick(int button_index) override; | 39 void ButtonClick(int button_index) override; |
| 41 void ButtonClickWithReply(int button_index, | 40 void ButtonClickWithReply(int button_index, |
| 42 const base::string16& reply) override; | 41 const base::string16& reply) override; |
| 43 | 42 |
| 44 protected: | 43 protected: |
| 45 ~WebNotificationDelegate() override; | 44 ~WebNotificationDelegate() override; |
| 46 const GURL& origin() { return origin_; } | 45 const GURL& origin() { return origin_; } |
| 47 | 46 |
| 48 private: | 47 private: |
| 49 NotificationCommon::Type notification_type_; | 48 NotificationCommon::Type notification_type_; |
| 50 Profile* profile_; | 49 Profile* profile_; |
| 51 std::string notification_id_; | 50 std::string notification_id_; |
| 52 GURL origin_; | 51 GURL origin_; |
| 53 | 52 |
| 54 DISALLOW_COPY_AND_ASSIGN(WebNotificationDelegate); | 53 DISALLOW_COPY_AND_ASSIGN(WebNotificationDelegate); |
| 55 }; | 54 }; |
| 56 | 55 |
| 57 #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ | 56 #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ |
| OLD | NEW |