Switch global error menu icon to vectorized MD asset
[chromium-blink-merge.git] / chrome / browser / notifications / persistent_notification_delegate.h
blobd7f88470aa9d73931d96dbdb4f8f602774cbe8f9
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.
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_
8 #include <stdint.h>
9 #include <string>
11 #include "chrome/browser/notifications/notification_delegate.h"
12 #include "url/gurl.h"
14 namespace content {
15 class BrowserContext;
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_t persistent_notification_id,
26 const GURL& origin);
28 // Persistent id of this notification in the notification database. To be
29 // used when retrieving all information associated with it.
30 int64_t persistent_notification_id() const {
31 return persistent_notification_id_;
34 // NotificationDelegate implementation.
35 void Display() override;
36 void Close(bool by_user) override;
37 void Click() override;
38 void ButtonClick(int button_index) override;
39 std::string id() const override;
41 protected:
42 ~PersistentNotificationDelegate() override;
44 private:
45 content::BrowserContext* browser_context_;
46 int64_t persistent_notification_id_;
47 GURL origin_;
49 std::string id_;
52 #endif // CHROME_BROWSER_NOTIFICATIONS_PERSISTENT_NOTIFICATION_DELEGATE_H_