Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(318)

Side by Side Diff: chrome/browser/notifications/persistent_notification_delegate.h

Issue 784383002: Support persistent notifications in the PlatformNotificationServiceImpl. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@n-chrome-base
Patch Set: add copyright header Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/notifications/persistent_notification_delegate.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright 2014 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_PERSISTENT_NOTIFICATION_DELEGATE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
7
8 #include <string>
9
10 #include "chrome/browser/notifications/notification_delegate.h"
11 #include "content/public/common/platform_notification_data.h"
12 #include "url/gurl.h"
13
14 namespace content {
15 class BrowserContext;
16 }
17
18 // Delegate responsible for listening to the click event on persistent
19 // notifications, to forward them to the PlatformNotificationService so that
20 // JavaScript events can be fired on the associated Service Worker.
21 class PersistentNotificationDelegate : public NotificationDelegate {
22 public:
23 PersistentNotificationDelegate(
24 content::BrowserContext* browser_context,
25 int64 service_worker_registration_id,
26 const GURL& origin,
27 const content::PlatformNotificationData& notification_data);
28
29 // NotificationDelegate implementation.
30 void Display() override;
31 void Close(bool by_user) override;
32 void Click() override;
33 std::string id() const override;
34
35 protected:
36 ~PersistentNotificationDelegate() override;
37
38 private:
39 content::BrowserContext* browser_context_;
40 int64 service_worker_registration_id_;
41 GURL origin_;
42 content::PlatformNotificationData notification_data_;
43
44 std::string id_;
45 };
46
47 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/notifications/persistent_notification_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698