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

Unified Diff: chrome/browser/notifications/persistent_notification_delegate.cc

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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/notifications/persistent_notification_delegate.cc
diff --git a/chrome/browser/notifications/persistent_notification_delegate.cc b/chrome/browser/notifications/persistent_notification_delegate.cc
index 1e05cbf76f76557777370a98758c20a37c70e71d..91c26b7a5495639ca8461d4cf687338353b763e9 100644
--- a/chrome/browser/notifications/persistent_notification_delegate.cc
+++ b/chrome/browser/notifications/persistent_notification_delegate.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/notifications/persistent_notification_delegate.h"
+#include "base/strings/nullable_string16.h"
+#include "base/strings/string16.h"
#include "chrome/browser/notifications/platform_notification_service_impl.h"
#include "url/gurl.h"
@@ -26,7 +28,8 @@ void PersistentNotificationDelegate::Close(bool by_user) {
void PersistentNotificationDelegate::Click() {
PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
- browser_context(), id(), origin(), -1 /* action_index */);
+ browser_context(), id(), origin(), -1 /* action_index */,
+ base::NullableString16() /* reply */);
}
void PersistentNotificationDelegate::ButtonClick(int button_index) {
@@ -37,5 +40,20 @@ void PersistentNotificationDelegate::ButtonClick(int button_index) {
}
PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
- browser_context(), id(), origin(), button_index);
+ browser_context(), id(), origin(), button_index,
+ base::NullableString16() /* reply */);
+}
+
+void PersistentNotificationDelegate::ButtonClickWithReply(
+ int button_index,
+ const base::string16& reply) {
+ DCHECK_GE(button_index, 0);
+ if (button_index == notification_settings_index_) {
Peter Beverloo 2016/10/11 14:22:56 DCHECK_NE? Why would the site settings button take
awdf 2016/10/11 15:51:27 oops - this came from copy pasting the method abov
awdf 2016/10/12 10:44:58 I remember why it's gnarly now - it's because ther
awdf 2016/10/12 13:26:42 Done (removed the unnecessary settings check, but
+ NotificationCommon::OpenNotificationSettings(browser_context());
+ return;
+ }
+
+ PlatformNotificationServiceImpl::GetInstance()->OnPersistentNotificationClick(
+ browser_context(), id(), origin(), button_index,
+ base::NullableString16(reply, false /* is_null */));
}

Powered by Google App Engine
This is Rietveld 408576698