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

Unified Diff: content/browser/notifications/type_converters.cc

Issue 1904163002: Move Web Notifications to use Mojo Base URL: https://chromium.googlesource.com/chromium/src.git@skbitmap-blink
Patch Set: it works \o/ Created 4 years, 8 months 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/browser/notifications/type_converters.cc
diff --git a/content/browser/notifications/type_converters.cc b/content/browser/notifications/type_converters.cc
index 823eaa16d6fa09fe584bead2a2f1a95c9920448d..5bfc53f8a481a2d45ced1445c66ae66b32a18dbd 100644
--- a/content/browser/notifications/type_converters.cc
+++ b/content/browser/notifications/type_converters.cc
@@ -6,8 +6,11 @@
#include "base/strings/utf_string_conversions.h"
#include "base/time/time.h"
+#include "skia/public/type_converters.h"
using blink::mojom::NotificationDirection;
+using blink::mojom::NotificationResourcesPtr;
+using content::NotificationResources;
using content::PlatformNotificationData;
namespace mojo {
@@ -136,4 +139,20 @@ TypeConverter<blink::mojom::NotificationPtr, PlatformNotificationData>::Convert(
return notification;
}
+NotificationResources
+TypeConverter<NotificationResources, NotificationResourcesPtr>::Convert(
+ const NotificationResourcesPtr& notification_resources) {
+ NotificationResources resources;
+ resources.notification_icon = notification_resources->icon.To<SkBitmap>();
+ resources.badge = notification_resources->badge.To<SkBitmap>();
+
+ resources.action_icons.resize(notification_resources->action_icons.size());
+ for (size_t i = 0; i < notification_resources->action_icons.size(); ++i) {
+ resources.action_icons[i] =
+ notification_resources->action_icons[i].To<SkBitmap>();
+ }
+
+ return resources;
+}
+
} // namespace mojo
« no previous file with comments | « content/browser/notifications/type_converters.h ('k') | content/browser/renderer_host/render_process_host_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698