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

Side by Side Diff: chrome/browser/extensions/api/notifications/extension_notification_handler.h

Issue 2799343003: Add support for native extension notifications (Closed)
Patch Set: Created 3 years, 8 months 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
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_
6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_ 6 #define CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HANDL ER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "chrome/browser/notifications/notification_handler.h" 9 #include "chrome/browser/notifications/non_persistent_notification_handler.h"
10 10
11 // Handler for notifications shown by extensions. Will be created and owned by 11 // Handler for notifications shown by extensions. Will be created and owned by
12 // the NotificationDisplayService. 12 // the NotificationDisplayService.
13 class ExtensionNotificationHandler : public NotificationHandler { 13 class ExtensionNotificationHandler : public NonPersistentNotificationHandler {
Peter Beverloo 2017/04/07 02:26:53 Hmm. I like the idea of reasoning about extension
Miguel Garcia 2017/04/07 13:32:06 Acknowledged.
14 public: 14 public:
15 ExtensionNotificationHandler(); 15 ExtensionNotificationHandler();
16 ~ExtensionNotificationHandler() override; 16 ~ExtensionNotificationHandler() override;
17 17
18 // NotificationHandler implementation.
19 void OnClose(Profile* profile,
20 const std::string& origin,
21 const std::string& notification_id,
22 bool by_user) override;
23 void OnClick(Profile* profile,
24 const std::string& origin,
25 const std::string& notification_id,
26 int action_index,
27 const base::NullableString16& reply) override;
28 void OpenSettings(Profile* profile) override; 18 void OpenSettings(Profile* profile) override;
29 void RegisterNotification(const std::string& notification_id,
30 NotificationDelegate* delegate) override;
31 19
32 private: 20 private:
33 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler); 21 DISALLOW_COPY_AND_ASSIGN(ExtensionNotificationHandler);
34 }; 22 };
35 23
36 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_ 24 #endif // CHROME_BROWSER_EXTENSIONS_API_NOTIFICATIONS_EXTENSION_NOTIFICATION_HA NDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698