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

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

Issue 1509923002: Implement native web notifications for mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_
7
8 #include <map>
9 #include <set>
10 #include <string>
11
12 #include "base/mac/scoped_nsobject.h"
13 #include "base/mac/sdk_forward_declarations.h"
14 #include "chrome/browser/notifications/notification_ui_manager.h"
15
16 class Notification;
17 @class NotificationCenterDelegate;
18 class PrefService;
19 class Profile;
20
21 // This class is an implementation of NotificationUIManager that will
22 // send platform notifications to the Notification Center on 10.8 and above.
Peter Beverloo 2015/12/09 00:12:00 This would be an excellent place to document *why*
Miguel Garcia 2015/12/10 20:16:30 Done.
23 class NotificationUIManagerMac : public NotificationUIManager {
24 public:
25 NotificationUIManagerMac();
26 ~NotificationUIManagerMac() override;
27
28 // NotificationUIManager implementation
29 void Add(const Notification& notification, Profile* profile) override;
30 bool Update(const Notification& notification, Profile* profile) override;
31 const Notification* FindById(const std::string& delegate_id,
32 ProfileID profile_id) const override;
33 bool CancelById(const std::string& delegate_id,
34 ProfileID profile_id) override;
35 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
36 ProfileID profile_id,
37 const GURL& source) override;
38 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override;
39 bool CancelAllBySourceOrigin(const GURL& source_origin) override;
40 bool CancelAllByProfile(ProfileID profile_id) override;
41 void CancelAll() override;
42 bool AcceptNativeNotifications() override;
43
44 private:
45 // Cocoa class that receives callbacks from the NSUserNotificationCenter.
46 base::scoped_nsobject<NotificationCenterDelegate> delegate_;
47
48 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac);
49 };
50
51 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698