Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(220)

Side by Side Diff: chrome/browser/notifications/notification_ui_manager_mac.h

Issue 1509923002: Implement native web notifications for mac (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(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"
12 #include "base/macros.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
33 // |delegate_id| need to reference a PersistentNotificationDelegate
34 const Notification* FindById(const std::string& delegate_id,
35 ProfileID profile_id) const override;
36
37 // |delegate_id| need to reference a PersistentNotificationDelegate
38 bool CancelById(const std::string& delegate_id,
39 ProfileID profile_id) override;
40 std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
41 ProfileID profile_id,
42 const GURL& source) override;
43 std::set<std::string> GetAllIdsByProfile(ProfileID profile_id) override;
44 bool CancelAllBySourceOrigin(const GURL& source_origin) override;
45 bool CancelAllByProfile(ProfileID profile_id) override;
46 void CancelAll() 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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698