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