| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ | 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |
| 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ | 6 #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |
| 7 | 7 |
| 8 #import <AppKit/AppKit.h> | 8 #import <AppKit/AppKit.h> |
| 9 | 9 |
| 10 #include <map> | 10 #include <map> |
| 11 #include <set> |
| 11 | 12 |
| 12 #include "base/basictypes.h" | 13 #include "base/basictypes.h" |
| 13 #include "base/memory/scoped_nsobject.h" | 14 #include "base/memory/scoped_nsobject.h" |
| 14 #include "base/memory/scoped_ptr.h" | 15 #include "base/memory/scoped_ptr.h" |
| 15 #include "base/string16.h" | 16 #include "base/string16.h" |
| 16 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" | 17 #include "chrome/browser/notifications/balloon_notification_ui_manager.h" |
| 17 | 18 |
| 18 @protocol CrUserNotification; | 19 @protocol CrUserNotification; |
| 19 class Notification; | 20 class Notification; |
| 20 @class NotificationCenterDelegate; | 21 @class NotificationCenterDelegate; |
| 21 class PrefService; | 22 class PrefService; |
| 22 class Profile; | 23 class Profile; |
| 23 | 24 |
| 24 // This class is an implementation of BalloonNotificationUIManager that will | 25 // This class is an implementation of BalloonNotificationUIManager that will |
| 25 // send text-only (non-HTML) notifications to Notification Center on 10.8. This | 26 // send text-only (non-HTML) notifications to Notification Center on 10.8. This |
| 26 // class is only instantiated on 10.8 and above. For HTML notifications, | 27 // class is only instantiated on 10.8 and above. For HTML notifications, |
| 27 // this class delegates to the base class. | 28 // this class delegates to the base class. |
| 28 class NotificationUIManagerMac : public BalloonNotificationUIManager { | 29 class NotificationUIManagerMac : public BalloonNotificationUIManager { |
| 29 public: | 30 public: |
| 30 explicit NotificationUIManagerMac(PrefService* local_state); | 31 explicit NotificationUIManagerMac(PrefService* local_state); |
| 31 virtual ~NotificationUIManagerMac(); | 32 virtual ~NotificationUIManagerMac(); |
| 32 | 33 |
| 33 // NotificationUIManager: | 34 // NotificationUIManager: |
| 34 virtual void Add(const Notification& notification, | 35 virtual void Add(const Notification& notification, |
| 35 Profile* profile) OVERRIDE; | 36 Profile* profile) OVERRIDE; |
| 37 virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| 38 Profile* profile, const GURL& source_origin) OVERRIDE; |
| 36 virtual bool CancelById(const std::string& notification_id) OVERRIDE; | 39 virtual bool CancelById(const std::string& notification_id) OVERRIDE; |
| 37 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; | 40 virtual bool CancelAllBySourceOrigin(const GURL& source_origin) OVERRIDE; |
| 38 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE; | 41 virtual bool CancelAllByProfile(Profile* profile) OVERRIDE; |
| 39 virtual void CancelAll() OVERRIDE; | 42 virtual void CancelAll() OVERRIDE; |
| 40 | 43 |
| 41 // Returns the corresponding C++ object for the Cocoa notification object, | 44 // Returns the corresponding C++ object for the Cocoa notification object, |
| 42 // or NULL if it could not be found. | 45 // or NULL if it could not be found. |
| 43 const Notification* FindNotificationWithCocoaNotification( | 46 const Notification* FindNotificationWithCocoaNotification( |
| 44 id<CrUserNotification> notification) const; | 47 id<CrUserNotification> notification) const; |
| 45 | 48 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 75 | 78 |
| 76 // Maps notification_ids to ControllerNotifications. The map owns the value, | 79 // Maps notification_ids to ControllerNotifications. The map owns the value, |
| 77 // so it must be deleted when remvoed from the map. This is typically handled | 80 // so it must be deleted when remvoed from the map. This is typically handled |
| 78 // in RemoveNotification. | 81 // in RemoveNotification. |
| 79 NotificationMap notification_map_; | 82 NotificationMap notification_map_; |
| 80 | 83 |
| 81 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac); | 84 DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac); |
| 82 }; | 85 }; |
| 83 | 86 |
| 84 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ | 87 #endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |
| OLD | NEW |