| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/push_messaging/push_messaging_notification_manager.h" | 5 #include "chrome/browser/push_messaging/push_messaging_notification_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <bitset> | 9 #include <bitset> |
| 10 | 10 |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 | 60 |
| 61 content::StoragePartition* GetStoragePartition(Profile* profile, | 61 content::StoragePartition* GetStoragePartition(Profile* profile, |
| 62 const GURL& origin) { | 62 const GURL& origin) { |
| 63 return content::BrowserContext::GetStoragePartitionForSite(profile, origin); | 63 return content::BrowserContext::GetStoragePartitionForSite(profile, origin); |
| 64 } | 64 } |
| 65 | 65 |
| 66 NotificationDatabaseData CreateDatabaseData( | 66 NotificationDatabaseData CreateDatabaseData( |
| 67 const GURL& origin, | 67 const GURL& origin, |
| 68 int64_t service_worker_registration_id) { | 68 int64_t service_worker_registration_id) { |
| 69 PlatformNotificationData notification_data; | 69 PlatformNotificationData notification_data; |
| 70 notification_data.title = | 70 notification_data.title = url_formatter::FormatUrlForSecurityDisplay( |
| 71 url_formatter::FormatUrlForSecurityDisplayOmitScheme(origin); | 71 origin, url_formatter::SchemeDisplay::OMIT_HTTP_AND_HTTPS); |
| 72 notification_data.direction = | 72 notification_data.direction = |
| 73 PlatformNotificationData::DIRECTION_LEFT_TO_RIGHT; | 73 PlatformNotificationData::DIRECTION_LEFT_TO_RIGHT; |
| 74 notification_data.body = | 74 notification_data.body = |
| 75 l10n_util::GetStringUTF16(IDS_PUSH_MESSAGING_GENERIC_NOTIFICATION_BODY); | 75 l10n_util::GetStringUTF16(IDS_PUSH_MESSAGING_GENERIC_NOTIFICATION_BODY); |
| 76 notification_data.tag = kPushMessagingForcedNotificationTag; | 76 notification_data.tag = kPushMessagingForcedNotificationTag; |
| 77 notification_data.icon = GURL(); | 77 notification_data.icon = GURL(); |
| 78 notification_data.silent = true; | 78 notification_data.silent = true; |
| 79 | 79 |
| 80 NotificationDatabaseData database_data; | 80 NotificationDatabaseData database_data; |
| 81 database_data.origin = origin; | 81 database_data.origin = origin; |
| (...skipping 248 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 330 message_handled_closure.Run(); | 330 message_handled_closure.Run(); |
| 331 return; | 331 return; |
| 332 } | 332 } |
| 333 | 333 |
| 334 PlatformNotificationServiceImpl::GetInstance()->DisplayPersistentNotification( | 334 PlatformNotificationServiceImpl::GetInstance()->DisplayPersistentNotification( |
| 335 profile_, persistent_notification_id, origin, notification_data, | 335 profile_, persistent_notification_id, origin, notification_data, |
| 336 NotificationResources()); | 336 NotificationResources()); |
| 337 | 337 |
| 338 message_handled_closure.Run(); | 338 message_handled_closure.Run(); |
| 339 } | 339 } |
| OLD | NEW |