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

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

Issue 1644083002: Fetch notification action icons and pass them through in resources. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@ActionIconBlink
Patch Set: Rebase. Created 4 years, 10 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
« no previous file with comments | « no previous file | content/child/notifications/notification_image_loader.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..b9818d18eeff4c1bea17d9a4979135332d560e91 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,16 +47,15 @@ class NotificationImageLoader
: public blink::WebURLLoaderClient,
public base::RefCountedThreadSafe<NotificationImageLoader,
NotificationImageLoaderDeleter> {
- using ImageLoadCompletedCallback = base::Callback<void(int, const SkBitmap&)>;
-
public:
NotificationImageLoader(
const ImageLoadCompletedCallback& callback,
- const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner);
+ const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner,
+ const scoped_refptr<base::SingleThreadTaskRunner>& main_task_runner);
// 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,
@@ -88,9 +91,8 @@ class NotificationImageLoader
ImageLoadCompletedCallback callback_;
scoped_refptr<base::SingleThreadTaskRunner> worker_task_runner_;
- scoped_refptr<base::SingleThreadTaskRunner> main_thread_task_runner_;
+ scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
- int notification_id_;
bool completed_;
scoped_ptr<blink::WebURLLoader> url_loader_;
« no previous file with comments | « no previous file | content/child/notifications/notification_image_loader.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698