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

Unified Diff: content/child/notifications/notification_image_loader.h

Issue 1620203004: Notification action icons prototype. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Make it work on Android and clean up. Created 4 years, 11 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/child/notifications/notification_image_loader.h
diff --git a/content/child/notifications/notification_image_loader.h b/content/child/notifications/notification_image_loader.h
index 33297c973d0e8dd4dc43d829f6df2fc5b948a3ea..2b7a7cc823aa47bd6b6c5b5084101f68c5b82833 100644
--- a/content/child/notifications/notification_image_loader.h
+++ b/content/child/notifications/notification_image_loader.h
@@ -33,6 +33,10 @@ namespace content {
struct NotificationImageLoaderDeleter;
+// The |image| may be empty if the request failed or the image data could not be
+// decoded.
+using ImageLoadCompletedCallback = base::Callback<void(const SkBitmap& image)>;
+
// Downloads the image associated with a notification and decodes the received
// image. This must be completed before notifications are shown to the user.
// Image downloaders must not be re-used for multiple notifications.
@@ -43,8 +47,6 @@ class NotificationImageLoader
: public blink::WebURLLoaderClient,
public base::RefCountedThreadSafe<NotificationImageLoader,
NotificationImageLoaderDeleter> {
- using ImageLoadCompletedCallback = base::Callback<void(int, const SkBitmap&)>;
-
public:
NotificationImageLoader(
const ImageLoadCompletedCallback& callback,
@@ -52,7 +54,7 @@ class NotificationImageLoader
// Asynchronously starts loading |image_url| using a Blink WebURLLoader. Must
// only be called on the main thread.
- void StartOnMainThread(int notification_id, const GURL& image_url);
+ void StartOnMainThread(const GURL& image_url);
// blink::WebURLLoaderClient implementation.
void didReceiveData(blink::WebURLLoader* loader,
@@ -90,7 +92,6 @@ class NotificationImageLoader
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
- int notification_id_;
bool completed_;
scoped_ptr<blink::WebURLLoader> url_loader_;
« no previous file with comments | « content/child/notifications/notification_data_conversions.cc ('k') | content/child/notifications/notification_image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698