blob: 8c1844942d7f693d03b775c56dcf8fa229d0cc65 [file] [log] [blame]
bmalcolmf8395c562016-09-29 22:49:141// 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
bmalcolm989c73242016-10-10 17:42:4510#include "base/feature_list.h"
bmalcolmf8395c562016-09-29 22:49:1411#include "base/macros.h"
miguelg40b10fd2017-06-09 13:54:0912#include "chrome/browser/notifications/notification_common.h"
bmalcolmf8395c562016-09-29 22:49:1413#include "chrome/browser/notifications/notification_delegate.h"
14#include "url/gurl.h"
15
miguelg40b10fd2017-06-09 13:54:0916class Profile;
bmalcolmf8395c562016-09-29 22:49:1417
bmalcolm989c73242016-10-10 17:42:4518namespace features {
19
20extern const base::Feature kAllowFullscreenWebNotificationsFeature;
21
22} // namespace features
23
miguelg40b10fd2017-06-09 13:54:0924// Delegate class for Web Notifications.
bmalcolmf8395c562016-09-29 22:49:1425class WebNotificationDelegate : public NotificationDelegate {
26 public:
miguelg40b10fd2017-06-09 13:54:0927 WebNotificationDelegate(NotificationCommon::Type notification_type,
28 Profile* profile,
29 const std::string& notification_id,
30 const GURL& origin);
31
bmalcolmf8395c562016-09-29 22:49:1432 // NotificationDelegate implementation.
33 std::string id() const override;
peter9b6e3c72017-04-10 18:35:4534 bool SettingsClick() override;
bmalcolmf8395c562016-09-29 22:49:1435 bool ShouldDisplaySettingsButton() override;
36 bool ShouldDisplayOverFullscreen() const override;
miguelg40b10fd2017-06-09 13:54:0937 void Close(bool by_user) override;
38 void Click() override;
39 void ButtonClick(int button_index) override;
40 void ButtonClickWithReply(int button_index,
41 const base::string16& reply) override;
bmalcolmf8395c562016-09-29 22:49:1442
43 protected:
bmalcolmf8395c562016-09-29 22:49:1444 ~WebNotificationDelegate() override;
bmalcolmf8395c562016-09-29 22:49:1445 const GURL& origin() { return origin_; }
46
47 private:
miguelg40b10fd2017-06-09 13:54:0948 NotificationCommon::Type notification_type_;
49 Profile* profile_;
bmalcolmf8395c562016-09-29 22:49:1450 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_