Chromium Code Reviews| Index: chrome/browser/notifications/notification_ui_manager_mac.h |
| diff --git a/chrome/browser/notifications/notification_ui_manager_mac.h b/chrome/browser/notifications/notification_ui_manager_mac.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e69948c943ed0d51366a91a0e7b2b000b4d77080 |
| --- /dev/null |
| +++ b/chrome/browser/notifications/notification_ui_manager_mac.h |
| @@ -0,0 +1,55 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |
| +#define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |
| + |
| +#include <map> |
| +#include <set> |
| +#include <string> |
| + |
| +#include "base/mac/scoped_nsobject.h" |
| +#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.
|
| +#include "chrome/browser/notifications/notification_ui_manager.h" |
| + |
| +class Notification; |
| +@class NotificationCenterDelegate; |
| +@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
|
| +@class NSUserNotificationCenter; |
| +class PrefService; |
| +class Profile; |
| + |
| +// This class is an implementation of NotificationUIManager that will |
| +// send platform notifications to the Notification Center on 10.8 and above. |
| +// 10.7 and below don't offer native notification support so chrome |
| +// notifications are still used there. |
| +class NotificationUIManagerMac : public NotificationUIManager { |
| + public: |
| + NotificationUIManagerMac(); |
| + ~NotificationUIManagerMac() override; |
| + |
| + // NotificationUIManager implementation |
| + void Add(const Notification& notification, Profile* profile) override; |
| + bool Update(const Notification& notification, Profile* profile) override; |
| + const Notification* FindById(const std::string& delegate_id, |
| + ProfileID profile_id) const override; |
| + bool CancelById(const std::string& delegate_id, |
| + ProfileID profile_id) override; |
| + std::set<std::string> GetAllIdsByProfileAndSourceOrigin( |
| + ProfileID profile_id, |
| + const GURL& source) override; |
| + std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override; |
| + bool CancelAllBySourceOrigin(const GURL& source_origin) override; |
| + bool CancelAllByProfile(ProfileID profile_id) override; |
| + void CancelAll() override; |
| + bool AcceptNativeNotifications() override; |
| + |
| + private: |
| + // Cocoa class that receives callbacks from the NSUserNotificationCenter. |
| + base::scoped_nsobject<NotificationCenterDelegate> delegate_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(NotificationUIManagerMac); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_UI_MANAGER_MAC_H_ |