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

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

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.cc
diff --git a/content/child/notifications/notification_image_loader.cc b/content/child/notifications/notification_image_loader.cc
index 4eed91fa3be624782ce07d5131c69d7fcb84a2f2..715ef54af7961e954d3996fdb29b4d0af6b4eede 100644
--- a/content/child/notifications/notification_image_loader.cc
+++ b/content/child/notifications/notification_image_loader.cc
@@ -26,7 +26,6 @@ NotificationImageLoader::NotificationImageLoader(
const scoped_refptr<base::SingleThreadTaskRunner>& worker_task_runner)
: callback_(callback),
worker_task_runner_(worker_task_runner),
- notification_id_(0),
completed_(false) {}
NotificationImageLoader::~NotificationImageLoader() {
@@ -34,13 +33,11 @@ NotificationImageLoader::~NotificationImageLoader() {
DCHECK(main_thread_task_runner_->BelongsToCurrentThread());
}
-void NotificationImageLoader::StartOnMainThread(int notification_id,
- const GURL& image_url) {
+void NotificationImageLoader::StartOnMainThread(const GURL& image_url) {
DCHECK(ChildThreadImpl::current());
DCHECK(!url_loader_);
main_thread_task_runner_ = base::ThreadTaskRunnerHandle::Get();
- notification_id_ = notification_id;
WebURL image_web_url(image_url);
WebURLRequest request(image_web_url);
@@ -84,10 +81,9 @@ void NotificationImageLoader::RunCallbackOnWorkerThread() {
SkBitmap icon = GetDecodedImage();
if (worker_task_runner_->BelongsToCurrentThread()) {
- callback_.Run(notification_id_, icon);
+ callback_.Run(icon);
} else {
- worker_task_runner_->PostTask(
- FROM_HERE, base::Bind(callback_, notification_id_, icon));
+ worker_task_runner_->PostTask(FROM_HERE, base::Bind(callback_, icon));
}
}
« no previous file with comments | « content/child/notifications/notification_image_loader.h ('k') | content/child/notifications/notification_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698