Index: content/child/notifications/notification_manager.cc |
diff --git a/content/child/notifications/notification_manager.cc b/content/child/notifications/notification_manager.cc |
index 4289d107192d303b267760da35dad165cec2d86c..05c3d5249517c04788c938975bc5dc95144b8641 100644 |
--- a/content/child/notifications/notification_manager.cc |
+++ b/content/child/notifications/notification_manager.cc |
@@ -7,13 +7,14 @@ |
#include "base/lazy_instance.h" |
#include "base/strings/utf_string_conversions.h" |
#include "base/threading/thread_local.h" |
+#include "content/child/notifications/notification_data_conversions.h" |
#include "content/child/notifications/notification_dispatcher.h" |
#include "content/child/notifications/notification_image_loader.h" |
#include "content/child/service_worker/web_service_worker_registration_impl.h" |
#include "content/child/thread_safe_sender.h" |
#include "content/child/worker_task_runner.h" |
#include "content/common/platform_notification_messages.h" |
-#include "content/public/common/show_desktop_notification_params.h" |
+#include "content/public/common/platform_notification_data.h" |
#include "third_party/WebKit/public/platform/WebNotificationData.h" |
#include "third_party/WebKit/public/platform/WebNotificationDelegate.h" |
#include "third_party/WebKit/public/platform/WebSerializedOrigin.h" |
@@ -246,21 +247,16 @@ void NotificationManager::DisplayNotification( |
active_notifications_[notification_id] = delegate; |
- ShowDesktopNotificationHostMsgParams params; |
- params.origin = GURL(origin.string()); |
- params.title = notification_data.title; |
- params.body = notification_data.body; |
- |
+ SkBitmap icon; |
if (image_loader) |
- params.icon = image_loader->GetDecodedImage(); |
- |
- // TODO(peter): Remove the usage of the Blink WebTextDirection enumeration for |
- // the text direction of notifications throughout Chrome. |
- params.direction = blink::WebTextDirectionLeftToRight; |
- params.replace_id = notification_data.tag; |
+ icon = image_loader->GetDecodedImage(); |
- thread_safe_sender_->Send(new PlatformNotificationHostMsg_Show( |
- notification_id, params)); |
+ thread_safe_sender_->Send( |
+ new PlatformNotificationHostMsg_Show( |
+ notification_id, |
+ GURL(origin.string()), |
+ icon, |
+ ToPlatformNotificationData(notification_data))); |
// If this Notification contained an icon, it can be safely deleted now. |
RemovePendingPageNotification(delegate); |
@@ -272,23 +268,19 @@ void NotificationManager::DisplayPersistentNotification( |
int64 service_worker_registration_id, |
int request_id, |
scoped_refptr<NotificationImageLoader> image_loader) { |
- ShowDesktopNotificationHostMsgParams params; |
- params.origin = GURL(origin.string()); |
- params.title = notification_data.title; |
- params.body = notification_data.body; |
- |
- // TODO(peter): Remove the usage of the Blink WebTextDirection enumeration for |
- // the text direction of notifications throughout Chrome. |
- params.direction = blink::WebTextDirectionLeftToRight; |
- params.replace_id = notification_data.tag; |
- |
+ SkBitmap icon; |
if (image_loader) { |
pending_persistent_notifications_.erase(image_loader); |
- params.icon = image_loader->GetDecodedImage(); |
+ icon = image_loader->GetDecodedImage(); |
} |
- thread_safe_sender_->Send(new PlatformNotificationHostMsg_ShowPersistent( |
- request_id, service_worker_registration_id, params)); |
+ thread_safe_sender_->Send( |
+ new PlatformNotificationHostMsg_ShowPersistent( |
+ request_id, |
+ service_worker_registration_id, |
+ GURL(origin.string()), |
+ icon, |
+ ToPlatformNotificationData(notification_data))); |
} |
bool NotificationManager::RemovePendingPageNotification( |