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 275 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
286 | 286 |
287 // TODO(peter): Icons for Web Notifications are currently always requested for | 287 // TODO(peter): Icons for Web Notifications are currently always requested for |
288 // 1x scale, whereas the displays on which they can be displayed can have a | 288 // 1x scale, whereas the displays on which they can be displayed can have a |
289 // different pixel density. Be smarter about this when the API gets updated | 289 // different pixel density. Be smarter about this when the API gets updated |
290 // with a way for developers to specify images of different resolutions. | 290 // with a way for developers to specify images of different resolutions. |
291 Notification notification(origin, notification_data.title, | 291 Notification notification(origin, notification_data.title, |
292 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), | 292 notification_data.body, gfx::Image::CreateFrom1xBitmap(icon), |
293 display_source, notification_data.tag, delegate); | 293 display_source, notification_data.tag, delegate); |
294 | 294 |
295 notification.set_context_message(display_source); | 295 notification.set_context_message(display_source); |
| 296 notification.set_vibrate(notification_data.vibrate); |
296 notification.set_silent(notification_data.silent); | 297 notification.set_silent(notification_data.silent); |
297 | 298 |
298 // Web Notifications do not timeout. | 299 // Web Notifications do not timeout. |
299 notification.set_never_timeout(true); | 300 notification.set_never_timeout(true); |
300 | 301 |
301 return notification; | 302 return notification; |
302 } | 303 } |
303 | 304 |
304 NotificationUIManager* | 305 NotificationUIManager* |
305 PlatformNotificationServiceImpl::GetNotificationUIManager() const { | 306 PlatformNotificationServiceImpl::GetNotificationUIManager() const { |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 formatted_origin.push_back(':'); | 355 formatted_origin.push_back(':'); |
355 formatted_origin.append(base::UTF8ToUTF16(origin.port())); | 356 formatted_origin.append(base::UTF8ToUTF16(origin.port())); |
356 } | 357 } |
357 return formatted_origin; | 358 return formatted_origin; |
358 } | 359 } |
359 | 360 |
360 // TODO(dewittj): Once file:// URLs are passed in to the origin | 361 // TODO(dewittj): Once file:// URLs are passed in to the origin |
361 // GURL here, begin returning the path as the display name. | 362 // GURL here, begin returning the path as the display name. |
362 return net::FormatUrl(origin, languages); | 363 return net::FormatUrl(origin, languages); |
363 } | 364 } |
OLD | NEW |