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 <set> | |
9 #include <string> | |
10 | |
11 #include "base/mac/scoped_nsobject.h" | |
Peter Beverloo
2016/01/08 05:14:26
+base/macros.h
Miguel Garcia
2016/01/08 11:46:55
Done.
| |
12 #include "chrome/browser/notifications/notification_ui_manager.h" | |
13 | |
14 class Notification; | |
15 @class NotificationCenterDelegate; | |
16 class PrefService; | |
17 class Profile; | |
18 | |
19 // This class is an implementation of NotificationUIManager that will | |
20 // send platform notifications to the Notification Center on 10.8 and above. | |
21 // 10.7 and below don't offer native notification support so chrome | |
22 // notifications are still used there. | |
Peter Beverloo
2016/01/08 05:14:26
Please document that delegates MUST be of type Per
Miguel Garcia
2016/01/08 11:46:55
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_ | |
OLD | NEW |