OLD | NEW |
---|---|
(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> | |
Robert Sesek
2015/12/21 23:14:25
Unused?
Miguel Garcia
2016/01/06 18:37:11
Done.
| |
9 #include <set> | |
10 #include <string> | |
11 | |
12 #include "base/mac/scoped_nsobject.h" | |
13 #include "chrome/browser/notifications/notification_ui_manager.h" | |
14 | |
15 class Notification; | |
16 @class NotificationCenterDelegate; | |
17 class PrefService; | |
18 class Profile; | |
19 | |
20 // This class is an implementation of NotificationUIManager that will | |
21 // send platform notifications to the Notification Center on 10.8 and above. | |
22 // 10.7 and below don't offer native notification support so chrome | |
23 // notifications are still used there. | |
24 class NotificationUIManagerMac : public NotificationUIManager { | |
25 public: | |
26 NotificationUIManagerMac(); | |
27 ~NotificationUIManagerMac() override; | |
28 | |
29 // NotificationUIManager implementation | |
30 void Add(const Notification& notification, Profile* profile) override; | |
31 bool Update(const Notification& notification, Profile* profile) override; | |
32 const Notification* FindById(const std::string& delegate_id, | |
33 ProfileID profile_id) const override; | |
34 bool CancelById(const std::string& delegate_id, | |
35 ProfileID profile_id) override; | |
36 std::set<std::string> GetAllIdsByProfileAndSourceOrigin( | |
37 ProfileID profile_id, | |
38 const GURL& source) override; | |
39 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; | |
40 bool CancelAllBySourceOrigin(const GURL& source_origin) override; | |
41 bool CancelAllByProfile(ProfileID profile_id) override; | |
42 void CancelAll() override; | |
43 bool AcceptNativeNotifications() override; | |
44 | |
45 private: | |
46 // Cocoa class that receives callbacks from the NSUserNotificationCenter. | |
47 base::scoped_nsobject<NotificationCenterDelegate> delegate_; | |
48 | |
49 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac); | |
50 }; | |
51 | |
52 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ | |
OLD | NEW |