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

Unified Diff: chrome/browser/notifications/notification_platform_bridge_mac.h

Issue 2093953002: Introduce a new API to handle native notification clicks (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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/notification_platform_bridge_mac.h
diff --git a/chrome/browser/notifications/notification_platform_bridge_mac.h b/chrome/browser/notifications/notification_platform_bridge_mac.h
index ad261aaa79764597f596b48b1d6b0472d580f005..0296d433a779a7a628771e717af6f913d6c821f9 100644
--- a/chrome/browser/notifications/notification_platform_bridge_mac.h
+++ b/chrome/browser/notifications/notification_platform_bridge_mac.h
@@ -10,10 +10,12 @@
#include "base/mac/scoped_nsobject.h"
#include "base/macros.h"
+#include "chrome/browser/notifications/notification_operation_common.h"
#include "chrome/browser/notifications/notification_platform_bridge.h"
class Notification;
@class NotificationCenterDelegate;
+@class NSDictionary;
@class NSUserNotificationCenter;
class PrefService;
@@ -26,10 +28,12 @@ class NotificationPlatformBridgeMac : public NotificationPlatformBridge {
~NotificationPlatformBridgeMac() override;
// NotificationPlatformBridge implementation.
- void Display(const std::string& notification_id,
- const std::string& profile_id,
- bool incognito,
- const Notification& notification) override;
+ void Display(
+ notification_operation_common::NotificationHandlerType notification_type,
+ const std::string& notification_id,
+ const std::string& profile_id,
+ bool incognito,
+ const Notification& notification) override;
void Close(const std::string& profile_id,
const std::string& notification_id) override;
bool GetDisplayed(const std::string& profile_id,
@@ -37,6 +41,12 @@ class NotificationPlatformBridgeMac : public NotificationPlatformBridge {
std::set<std::string>* notifications) const override;
bool SupportsNotificationCenter() const override;
+ // Perform some sanity checks on the returned values. Since the notification
+ // data comes from outside of Chrome it's better to do real production checks
+ // than just DCHECKS.
+ // Returns true if all the checks pass, false otherwise.
+ static bool VerifyNotificationData(NSDictionary* response);
+
private:
// Cocoa class that receives callbacks from the NSUserNotificationCenter.
base::scoped_nsobject<NotificationCenterDelegate> delegate_;

Powered by Google App Engine
This is Rietveld 408576698