OLD | NEW |
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 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 | 64 |
65 // Methods to setup and modify permission preferences. | 65 // Methods to setup and modify permission preferences. |
66 void GrantPermission(const GURL& origin); | 66 void GrantPermission(const GURL& origin); |
67 void DenyPermission(const GURL& origin); | 67 void DenyPermission(const GURL& origin); |
68 | 68 |
69 NotificationsPrefsCache* prefs_cache() { return prefs_cache_; } | 69 NotificationsPrefsCache* prefs_cache() { return prefs_cache_; } |
70 | 70 |
71 private: | 71 private: |
72 void InitPrefs(); | 72 void InitPrefs(); |
73 | 73 |
| 74 // Returns a display name for an origin, to be used in permission infobar |
| 75 // or on the frame of the notification toast. Different from the origin |
| 76 // itself when dealing with extensions. |
| 77 std::wstring DisplayNameForOrigin(const GURL& origin); |
| 78 |
74 // The profile which owns this object. | 79 // The profile which owns this object. |
75 Profile* profile_; | 80 Profile* profile_; |
76 | 81 |
77 // A cache of preferences which is accessible only on the IO thread | 82 // A cache of preferences which is accessible only on the IO thread |
78 // to service synchronous IPCs. | 83 // to service synchronous IPCs. |
79 scoped_refptr<NotificationsPrefsCache> prefs_cache_; | 84 scoped_refptr<NotificationsPrefsCache> prefs_cache_; |
80 | 85 |
81 // Non-owned pointer to the notification manager which manages the | 86 // Non-owned pointer to the notification manager which manages the |
82 // UI for desktop toasts. | 87 // UI for desktop toasts. |
83 NotificationUIManager* ui_manager_; | 88 NotificationUIManager* ui_manager_; |
84 | 89 |
85 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 90 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
86 }; | 91 }; |
87 | 92 |
88 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 93 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
OLD | NEW |