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

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

Issue 455004: Keep incognito notification preferences separate from regular ones, and don't... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_DESKTOP_NOTIFICATION_SERVICE_H_ 5 #ifndef CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ 6 #define CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
7 7
8 #include <set> 8 #include <set>
9 9
10 #include "base/basictypes.h" 10 #include "base/basictypes.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 NotificationsPrefsCache* prefs_cache() { return prefs_cache_; } 71 NotificationsPrefsCache* prefs_cache() { return prefs_cache_; }
72 72
73 // NotificationObserver interface. 73 // NotificationObserver interface.
74 virtual void Observe(NotificationType type, 74 virtual void Observe(NotificationType type,
75 const NotificationSource& source, 75 const NotificationSource& source,
76 const NotificationDetails& details); 76 const NotificationDetails& details);
77 77
78 private: 78 private:
79 void InitPrefs(); 79 void InitPrefs();
80 80
81 // Save a permission change to the profile.
82 void PersistPermissionChange(const GURL& origin, bool is_allowed);
83
81 // Returns a display name for an origin, to be used in permission infobar 84 // Returns a display name for an origin, to be used in permission infobar
82 // or on the frame of the notification toast. Different from the origin 85 // or on the frame of the notification toast. Different from the origin
83 // itself when dealing with extensions. 86 // itself when dealing with extensions.
84 std::wstring DisplayNameForOrigin(const GURL& origin); 87 std::wstring DisplayNameForOrigin(const GURL& origin);
85 88
86 // The profile which owns this object. 89 // The profile which owns this object.
87 Profile* profile_; 90 Profile* profile_;
88 91
89 // A cache of preferences which is accessible only on the IO thread 92 // A cache of preferences which is accessible only on the IO thread
90 // to service synchronous IPCs. 93 // to service synchronous IPCs.
91 scoped_refptr<NotificationsPrefsCache> prefs_cache_; 94 scoped_refptr<NotificationsPrefsCache> prefs_cache_;
92 95
93 // Non-owned pointer to the notification manager which manages the 96 // Non-owned pointer to the notification manager which manages the
94 // UI for desktop toasts. 97 // UI for desktop toasts.
95 NotificationUIManager* ui_manager_; 98 NotificationUIManager* ui_manager_;
96 99
97 // Connection to the service providing the other kind of notifications. 100 // Connection to the service providing the other kind of notifications.
98 NotificationRegistrar notification_registrar_; 101 NotificationRegistrar notification_registrar_;
99 102
100 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); 103 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService);
101 }; 104 };
102 105
103 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ 106 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698