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

Side by Side Diff: chrome/browser/notifications/non_persistent_notification_handler.cc

Issue 2859153002: Consider Button clicks for extension notifications (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/notifications/non_persistent_notification_handler.h" 5 #include "chrome/browser/notifications/non_persistent_notification_handler.h"
6 6
7 #include "base/strings/nullable_string16.h" 7 #include "base/strings/nullable_string16.h"
8 #include "chrome/browser/notifications/notification_delegate.h" 8 #include "chrome/browser/notifications/notification_delegate.h"
9 #include "chrome/browser/notifications/platform_notification_service_impl.h" 9 #include "chrome/browser/notifications/platform_notification_service_impl.h"
10 10
(...skipping 13 matching lines...) Expand all
24 24
25 void NonPersistentNotificationHandler::OnClick( 25 void NonPersistentNotificationHandler::OnClick(
26 Profile* profile, 26 Profile* profile,
27 const std::string& origin, 27 const std::string& origin,
28 const std::string& notification_id, 28 const std::string& notification_id,
29 int action_index, 29 int action_index,
30 const base::NullableString16& reply) { 30 const base::NullableString16& reply) {
31 DCHECK(reply.is_null()); 31 DCHECK(reply.is_null());
32 32
33 if (notifications_.find(notification_id) != notifications_.end()) { 33 if (notifications_.find(notification_id) != notifications_.end()) {
34 notifications_[notification_id]->Click(); 34 if (action_index >= 0)
35 notifications_[notification_id]->ButtonClick(action_index);
36 else
37 notifications_[notification_id]->Click();
35 } 38 }
36 } 39 }
37 40
38 void NonPersistentNotificationHandler::OpenSettings(Profile* profile) { 41 void NonPersistentNotificationHandler::OpenSettings(Profile* profile) {
39 NotificationCommon::OpenNotificationSettings(profile); 42 NotificationCommon::OpenNotificationSettings(profile);
40 } 43 }
41 44
42 void NonPersistentNotificationHandler::RegisterNotification( 45 void NonPersistentNotificationHandler::RegisterNotification(
43 const std::string& notification_id, 46 const std::string& notification_id,
44 NotificationDelegate* delegate) { 47 NotificationDelegate* delegate) {
45 notifications_[notification_id] = 48 notifications_[notification_id] =
46 scoped_refptr<NotificationDelegate>(delegate); 49 scoped_refptr<NotificationDelegate>(delegate);
47 } 50 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698