Chromium Code Reviews| 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 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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_silent(notification_data.silent); | 296 notification.set_silent(notification_data.silent); |
| 297 | 297 |
| 298 #if defined(OS_ANDROID) | |
|
Peter Beverloo
2015/04/26 23:26:41
Sorry, I didn't mean that you had to make this And
Sanghyun Park
2015/04/27 14:00:00
Okay I'll change to PS1.
| |
| 299 // This vibrate property currently has no effect on non-Android platforms. | |
| 300 // For reducing memory, virate is not set on non-Android platforms. | |
| 301 notification.set_vibrate(notification_data.vibrate); | |
| 302 #endif | |
| 303 | |
| 298 // Web Notifications do not timeout. | 304 // Web Notifications do not timeout. |
| 299 notification.set_never_timeout(true); | 305 notification.set_never_timeout(true); |
| 300 | 306 |
| 301 return notification; | 307 return notification; |
| 302 } | 308 } |
| 303 | 309 |
| 304 NotificationUIManager* | 310 NotificationUIManager* |
| 305 PlatformNotificationServiceImpl::GetNotificationUIManager() const { | 311 PlatformNotificationServiceImpl::GetNotificationUIManager() const { |
| 306 if (notification_ui_manager_for_tests_) | 312 if (notification_ui_manager_for_tests_) |
| 307 return notification_ui_manager_for_tests_; | 313 return notification_ui_manager_for_tests_; |
| (...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 354 formatted_origin.push_back(':'); | 360 formatted_origin.push_back(':'); |
| 355 formatted_origin.append(base::UTF8ToUTF16(origin.port())); | 361 formatted_origin.append(base::UTF8ToUTF16(origin.port())); |
| 356 } | 362 } |
| 357 return formatted_origin; | 363 return formatted_origin; |
| 358 } | 364 } |
| 359 | 365 |
| 360 // TODO(dewittj): Once file:// URLs are passed in to the origin | 366 // TODO(dewittj): Once file:// URLs are passed in to the origin |
| 361 // GURL here, begin returning the path as the display name. | 367 // GURL here, begin returning the path as the display name. |
| 362 return net::FormatUrl(origin, languages); | 368 return net::FormatUrl(origin, languages); |
| 363 } | 369 } |
| OLD | NEW |