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

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

Issue 2392343002: Plumbing in notification replies: PlatformNotificationService -> SW (Closed)
Patch Set: Pass the reply through from PNS -> SW so new test passes 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 #include "chrome/browser/notifications/persistent_notification_handler.h" 5 #include "chrome/browser/notifications/persistent_notification_handler.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/strings/nullable_string16.h"
8 #include "chrome/browser/notifications/platform_notification_service_impl.h" 9 #include "chrome/browser/notifications/platform_notification_service_impl.h"
9 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
10 11
11 PersistentNotificationHandler::PersistentNotificationHandler() {} 12 PersistentNotificationHandler::PersistentNotificationHandler() {}
12 PersistentNotificationHandler::~PersistentNotificationHandler() {} 13 PersistentNotificationHandler::~PersistentNotificationHandler() {}
13 14
14 void PersistentNotificationHandler::OnClose(Profile* profile, 15 void PersistentNotificationHandler::OnClose(Profile* profile,
15 const std::string& origin, 16 const std::string& origin,
16 const std::string& notification_id, 17 const std::string& notification_id,
17 bool by_user) { 18 bool by_user) {
18 if (!by_user) 19 if (!by_user)
19 return; // no need to propagate back programmatic close events 20 return; // no need to propagate back programmatic close events
20 21
21 const GURL notification_origin(origin); 22 const GURL notification_origin(origin);
22 DCHECK(notification_origin.is_valid()); 23 DCHECK(notification_origin.is_valid());
23 24
24 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose( 25 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClose(
25 profile, notification_id, notification_origin, by_user); 26 profile, notification_id, notification_origin, by_user);
26 } 27 }
27 28
28 void PersistentNotificationHandler::OnClick(Profile* profile, 29 void PersistentNotificationHandler::OnClick(Profile* profile,
29 const std::string& origin, 30 const std::string& origin,
30 const std::string& notification_id, 31 const std::string& notification_id,
31 int action_index) { 32 int action_index,
33 base::NullableString16 reply) {
32 const GURL notification_origin(origin); 34 const GURL notification_origin(origin);
33 DCHECK(notification_origin.is_valid()); 35 DCHECK(notification_origin.is_valid());
34 36
35 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick( 37 PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
36 profile, notification_id, notification_origin, action_index); 38 profile, notification_id, notification_origin, action_index, reply);
37 } 39 }
38 40
39 void PersistentNotificationHandler::OpenSettings(Profile* profile) { 41 void PersistentNotificationHandler::OpenSettings(Profile* profile) {
40 NotificationCommon::OpenNotificationSettings(profile); 42 NotificationCommon::OpenNotificationSettings(profile);
41 } 43 }
42 44
43 void PersistentNotificationHandler::RegisterNotification( 45 void PersistentNotificationHandler::RegisterNotification(
44 const std::string& notification_id, 46 const std::string& notification_id,
45 NotificationDelegate* delegate) { 47 NotificationDelegate* delegate) {
46 // Nothing to do here since there is no state kept. 48 // Nothing to do here since there is no state kept.
47 } 49 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698