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

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: adds browser tests 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
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/show_desktop_notification_params.h"
12
13 namespace content {
14 class BrowserContext;
15 }
16
17 // Delegate responsible for listening to the click event on persistent
18 // notifications, to forward them to the PlatformNotificationService so that
19 // JavaScript events can be fired on the associated Service Worker.
20 class PersistentNotificationDelegate : public NotificationDelegate {
21 public:
22 PersistentNotificationDelegate(
23 content::BrowserContext* browser_context,
24 int64 service_worker_registration_id,
25 const content::ShowDesktopNotificationHostMsgParams& params);
26
27 // NotificationDelegate implementation.
28 void Display() override;
29 void Close(bool by_user) override;
30 void Click() override;
31 std::string id() const override;
32
33 protected:
34 ~PersistentNotificationDelegate() override;
35
36 private:
37 content::BrowserContext* browser_context_;
38 int64 service_worker_registration_id_;
39 content::ShowDesktopNotificationHostMsgParams notification_data_;
40
41 std::string id_;
42 };
43
44 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698