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

Side by Side Diff: content/child/notifications/pending_notification.h

Issue 1750083004: Add badge to web notifications. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 #ifndef CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ 5 #ifndef CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_
6 #define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ 6 #define CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
(...skipping 30 matching lines...) Expand all
41 NotificationResources GetResources() const; 41 NotificationResources GetResources() const;
42 42
43 private: 43 private:
44 // Fetches an image using |image_web_url| asynchronously on the main thread. 44 // Fetches an image using |image_web_url| asynchronously on the main thread.
45 // The |image_callback| will be called on the worker thread. 45 // The |image_callback| will be called on the worker thread.
46 void FetchImageResource(const blink::WebURL& image_web_url, 46 void FetchImageResource(const blink::WebURL& image_web_url,
47 const ImageLoadCompletedCallback& image_callback); 47 const ImageLoadCompletedCallback& image_callback);
48 48
49 // To be called on the worker thread when the notification icon has been 49 // To be called on the worker thread when the notification icon has been
50 // fetched. 50 // fetched.
51 void DidFetchNotificationIcon(const SkBitmap& notification_icon); 51 void DidFetchNotificationIcon(const SkBitmap& icon);
52
53 // To be called on the worker thread when the small notification icon has been
54 // fetched.
55 void DidFetchSmallIcon(const SkBitmap& icon);
52 56
53 // To be called on the worker thread when an action icon has been fetched. 57 // To be called on the worker thread when an action icon has been fetched.
54 void DidFetchActionIcon(size_t action_index, const SkBitmap& action_icon); 58 void DidFetchActionIcon(size_t action_index, const SkBitmap& icon);
55 59
56 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; 60 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_;
57 61
58 SkBitmap notification_icon_; 62 SkBitmap notification_icon_;
59 63
64 SkBitmap small_icon_;
65
60 std::vector<SkBitmap> action_icons_; 66 std::vector<SkBitmap> action_icons_;
61 67
62 base::Closure fetches_finished_barrier_closure_; 68 base::Closure fetches_finished_barrier_closure_;
63 69
64 std::vector<scoped_refptr<NotificationImageLoader>> image_loaders_; 70 std::vector<scoped_refptr<NotificationImageLoader>> image_loaders_;
65 71
66 base::WeakPtrFactory<PendingNotification> weak_factory_; 72 base::WeakPtrFactory<PendingNotification> weak_factory_;
67 73
68 DISALLOW_COPY_AND_ASSIGN(PendingNotification); 74 DISALLOW_COPY_AND_ASSIGN(PendingNotification);
69 }; 75 };
70 76
71 } // namespace content 77 } // namespace content
72 78
73 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ 79 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698