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_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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
96 static string16 CreateDataUrl(int resource, | 96 static string16 CreateDataUrl(int resource, |
97 const std::vector<std::string>& subst); | 97 const std::vector<std::string>& subst); |
98 | 98 |
99 // Add a desktop notification. On non-Ash platforms this will generate a HTML | 99 // Add a desktop notification. On non-Ash platforms this will generate a HTML |
100 // notification from the input parameters. On Ash it will generate a normal | 100 // notification from the input parameters. On Ash it will generate a normal |
101 // ash notification. Returns the notification id. | 101 // ash notification. Returns the notification id. |
102 static std::string AddNotification(const GURL& origin_url, | 102 static std::string AddNotification(const GURL& origin_url, |
103 const string16& title, | 103 const string16& title, |
104 const string16& message, | 104 const string16& message, |
105 const GURL& icon_url, | 105 const GURL& icon_url, |
| 106 const string16& replace_id, |
106 NotificationDelegate* delegate, | 107 NotificationDelegate* delegate, |
107 Profile* profile); | 108 Profile* profile); |
108 | 109 |
109 // Same as above, but takes a gfx::ImageSkia for the icon instead. | 110 // Same as above, but takes a gfx::ImageSkia for the icon instead. |
110 static std::string AddIconNotification(const GURL& origin_url, | 111 static std::string AddIconNotification(const GURL& origin_url, |
111 const string16& title, | 112 const string16& title, |
112 const string16& message, | 113 const string16& message, |
113 const gfx::ImageSkia& icon, | 114 const gfx::ImageSkia& icon, |
114 NotificationDelegate* delegate, | 115 const string16& replace_id, |
115 Profile* profile); | 116 NotificationDelegate* delegate, |
| 117 Profile* profile); |
| 118 |
| 119 // Remove any active notification corresponding to |notification_id|. |
| 120 static void RemoveNotification(const std::string& notification_id); |
116 | 121 |
117 // The default content setting determines how to handle origins that haven't | 122 // The default content setting determines how to handle origins that haven't |
118 // been allowed or denied yet. If |provider_id| is not NULL, the id of the | 123 // been allowed or denied yet. If |provider_id| is not NULL, the id of the |
119 // provider which provided the default setting is assigned to it. | 124 // provider which provided the default setting is assigned to it. |
120 ContentSetting GetDefaultContentSetting(std::string* provider_id); | 125 ContentSetting GetDefaultContentSetting(std::string* provider_id); |
121 void SetDefaultContentSetting(ContentSetting setting); | 126 void SetDefaultContentSetting(ContentSetting setting); |
122 | 127 |
123 // NOTE: This should only be called on the UI thread. | 128 // NOTE: This should only be called on the UI thread. |
124 void ResetToDefaultContentSetting(); | 129 void ResetToDefaultContentSetting(); |
125 | 130 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 // Non-owned pointer to the notification manager which manages the | 168 // Non-owned pointer to the notification manager which manages the |
164 // UI for desktop toasts. | 169 // UI for desktop toasts. |
165 NotificationUIManager* ui_manager_; | 170 NotificationUIManager* ui_manager_; |
166 | 171 |
167 content::NotificationRegistrar notification_registrar_; | 172 content::NotificationRegistrar notification_registrar_; |
168 | 173 |
169 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); | 174 DISALLOW_COPY_AND_ASSIGN(DesktopNotificationService); |
170 }; | 175 }; |
171 | 176 |
172 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ | 177 #endif // CHROME_BROWSER_NOTIFICATIONS_DESKTOP_NOTIFICATION_SERVICE_H_ |
OLD | NEW |