OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #include "chrome/browser/notifications/platform_notification_service_impl.h" | 5 #include "chrome/browser/notifications/platform_notification_service_impl.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/browser/browser_process.h" | 9 #include "chrome/browser/browser_process.h" |
10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" | 10 #include "chrome/browser/notifications/desktop_notification_profile_util.h" |
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
264 | 264 |
265 // TODO(peter): Icons for Web Notifications are currently always requested for | 265 // TODO(peter): Icons for Web Notifications are currently always requested for |
266 // 1x scale, whereas the displays on which they can be displayed can have a | 266 // 1x scale, whereas the displays on which they can be displayed can have a |
267 // different pixel density. Be smarter about this when the API gets updated | 267 // different pixel density. Be smarter about this when the API gets updated |
268 // with a way for developers to specify images of different resolutions. | 268 // with a way for developers to specify images of different resolutions. |
269 Notification notification(origin, notification_data.title, | 269 Notification notification(origin, notification_data.title, |
270 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), | 270 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), |
271 display_source, notification_data.tag, delegate); | 271 display_source, notification_data.tag, delegate); |
272 | 272 |
273 notification.set_context_message(display_source); | 273 notification.set_context_message(display_source); |
| 274 notification.set_silent(notification_data.silent); |
274 | 275 |
275 // Web Notifications do not timeout. | 276 // Web Notifications do not timeout. |
276 notification.set_never_timeout(true); | 277 notification.set_never_timeout(true); |
277 | 278 |
278 return notification; | 279 return notification; |
279 } | 280 } |
280 | 281 |
281 NotificationUIManager* | 282 NotificationUIManager* |
282 PlatformNotificationServiceImpl::GetNotificationUIManager() const { | 283 PlatformNotificationServiceImpl::GetNotificationUIManager() const { |
283 if (notification_ui_manager_for_tests_) | 284 if (notification_ui_manager_for_tests_) |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 formatted_origin.push_back(':'); | 332 formatted_origin.push_back(':'); |
332 formatted_origin.append(base::UTF8ToUTF16(origin.port())); | 333 formatted_origin.append(base::UTF8ToUTF16(origin.port())); |
333 } | 334 } |
334 return formatted_origin; | 335 return formatted_origin; |
335 } | 336 } |
336 | 337 |
337 // TODO(dewittj): Once file:// URLs are passed in to the origin | 338 // TODO(dewittj): Once file:// URLs are passed in to the origin |
338 // GURL here, begin returning the path as the display name. | 339 // GURL here, begin returning the path as the display name. |
339 return net::FormatUrl(origin, languages); | 340 return net::FormatUrl(origin, languages); |
340 } | 341 } |
OLD | NEW |