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

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

Issue 2392343002: Plumbing in notification replies: PlatformNotificationService -> SW (Closed)
Patch Set: Remove todo as it doesn't seem necessary after all Created 4 years, 2 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 2016 The Chromium Authors. All rights reserved. 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 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_NOTIFICATIONS_NOTIFICATION_HANDLER_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_HANDLER_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_HANDLER_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_HANDLER_H_
7 7
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 10
11 #include "base/strings/nullable_string16.h"
12
11 class NotificationDelegate; 13 class NotificationDelegate;
12 class Profile; 14 class Profile;
13 15
14 // Interface that enables the different kind of notifications to process 16 // Interface that enables the different kind of notifications to process
15 // operations coming from the user. 17 // operations coming from the user.
16 class NotificationHandler { 18 class NotificationHandler {
17 public: 19 public:
18 virtual ~NotificationHandler() {} 20 virtual ~NotificationHandler() {}
19 21
20 // Process notification close events. 22 // Process notification close events.
21 virtual void OnClose(Profile* profile, 23 virtual void OnClose(Profile* profile,
22 const std::string& origin, 24 const std::string& origin,
23 const std::string& notification_id, 25 const std::string& notification_id,
24 bool by_user) = 0; 26 bool by_user) = 0;
25 27
26 // Process cliks to a notification or its buttons, depending on 28 // Process cliks to a notification or its buttons, depending on
27 // |action_index|. 29 // |action_index|.
28 virtual void OnClick(Profile* profile, 30 virtual void OnClick(Profile* profile,
29 const std::string& origin, 31 const std::string& origin,
30 const std::string& notification_id, 32 const std::string& notification_id,
31 int action_index) = 0; 33 int action_index,
34 const base::NullableString16& reply) = 0;
32 35
33 // Open notification settings. 36 // Open notification settings.
34 virtual void OpenSettings(Profile* profile) = 0; 37 virtual void OpenSettings(Profile* profile) = 0;
35 38
36 // Registers a |delegate| object with this handler. 39 // Registers a |delegate| object with this handler.
37 virtual void RegisterNotification(const std::string& notification_id, 40 virtual void RegisterNotification(const std::string& notification_id,
38 NotificationDelegate* delegate) = 0; 41 NotificationDelegate* delegate) = 0;
39 }; 42 };
40 43
41 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_HANDLER_H_ 44 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_HANDLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698