Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(379)

Unified Diff: content/child/notifications/notification_manager.cc

Issue 794633002: Remove ShowDesktopNotificationHostMsgParams in favor of PlatformNotificationData. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comments Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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(
« no previous file with comments | « content/child/notifications/notification_data_conversions_unittest.cc ('k') | content/common/platform_notification_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698