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. | |
Peter Beverloo
2016/09/27 17:17:37
nit: This may feel rather counter-intuitive today,
bmalcolm
2016/09/27 20:34:36
Done.
| |
21 class WebNotificationDelegate : public NotificationDelegate { | |
22 public: | |
23 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.
| |
24 const std::string& notification_id, | |
25 const GURL& origin); | |
26 | |
Peter Beverloo
2016/09/27 17:17:37
micro nit:
// NotificationDelegate implementation
bmalcolm
2016/09/27 20:34:36
Done.
| |
27 std::string id() const override; | |
28 void SettingsClick() override; | |
29 bool ShouldDisplaySettingsButton() override; | |
30 bool ShouldDisplayOverFullscreen() const override; | |
31 | |
32 protected: | |
33 ~WebNotificationDelegate() override; | |
34 | |
35 content::BrowserContext* browser_context() { return browser_context_; } | |
36 const GURL& origin() { return origin_; } | |
37 | |
38 private: | |
39 content::BrowserContext* browser_context_; | |
40 std::string notification_id_; | |
41 GURL origin_; | |
Peter Beverloo
2016/09/27 17:17:37
nit: DISALLOW_COPY_AND_ASSIGN(WebNotificationDeleg
bmalcolm
2016/09/27 20:34:36
Done.
| |
42 }; | |
43 | |
44 | |
45 #endif // CHROME_BROWSER_NOTIFICATIONS_WEB_NOTIFICATION_DELEGATE_H_ | |
OLD | NEW |