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

Side by Side Diff: content/child/notifications/notification_manager.cc

Issue 2261283002: Add Notification images (Blink + desktop implementation) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check IPC drawsNothing rather than isNull Created 4 years, 4 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 unified diff | Download patch
OLDNEW
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 "content/child/notifications/notification_manager.h" 5 #include "content/child/notifications/notification_manager.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/metrics/histogram_macros.h" 10 #include "base/metrics/histogram_macros.h"
(...skipping 12 matching lines...) Expand all
23 namespace content { 23 namespace content {
24 namespace { 24 namespace {
25 25
26 int CurrentWorkerId() { 26 int CurrentWorkerId() {
27 return WorkerThread::GetCurrentId(); 27 return WorkerThread::GetCurrentId();
28 } 28 }
29 29
30 NotificationResources ToNotificationResources( 30 NotificationResources ToNotificationResources(
31 std::unique_ptr<blink::WebNotificationResources> web_resources) { 31 std::unique_ptr<blink::WebNotificationResources> web_resources) {
32 NotificationResources resources; 32 NotificationResources resources;
33 resources.image = web_resources->image;
33 resources.notification_icon = web_resources->icon; 34 resources.notification_icon = web_resources->icon;
34 resources.badge = web_resources->badge; 35 resources.badge = web_resources->badge;
35 for (const auto& action_icon : web_resources->actionIcons) 36 for (const auto& action_icon : web_resources->actionIcons)
36 resources.action_icons.push_back(action_icon); 37 resources.action_icons.push_back(action_icon);
37 return resources; 38 return resources;
38 } 39 }
39 40
40 } // namespace 41 } // namespace
41 42
42 static base::LazyInstance<base::ThreadLocalPointer<NotificationManager>>::Leaky 43 static base::LazyInstance<base::ThreadLocalPointer<NotificationManager>>::Leaky
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 287
287 notifications[i] = web_notification_info; 288 notifications[i] = web_notification_info;
288 } 289 }
289 290
290 callbacks->onSuccess(notifications); 291 callbacks->onSuccess(notifications);
291 292
292 pending_get_notification_requests_.Remove(request_id); 293 pending_get_notification_requests_.Remove(request_id);
293 } 294 }
294 295
295 } // namespace content 296 } // namespace content
OLDNEW
« 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