OLD | NEW |
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 Loading... |
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& bitmap); |
| 52 |
| 53 // To be called on the worker thread when the badge has been fetched. |
| 54 void DidFetchBadge(const SkBitmap& bitmap); |
52 | 55 |
53 // To be called on the worker thread when an action icon has been fetched. | 56 // 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); | 57 void DidFetchActionIcon(size_t action_index, const SkBitmap& bitmap); |
55 | 58 |
56 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; | 59 scoped_refptr<base::SingleThreadTaskRunner> main_task_runner_; |
57 | 60 |
58 SkBitmap notification_icon_; | 61 SkBitmap notification_icon_; |
59 | 62 |
| 63 SkBitmap badge_; |
| 64 |
60 std::vector<SkBitmap> action_icons_; | 65 std::vector<SkBitmap> action_icons_; |
61 | 66 |
62 base::Closure fetches_finished_barrier_closure_; | 67 base::Closure fetches_finished_barrier_closure_; |
63 | 68 |
64 std::vector<scoped_refptr<NotificationImageLoader>> image_loaders_; | 69 std::vector<scoped_refptr<NotificationImageLoader>> image_loaders_; |
65 | 70 |
66 base::WeakPtrFactory<PendingNotification> weak_factory_; | 71 base::WeakPtrFactory<PendingNotification> weak_factory_; |
67 | 72 |
68 DISALLOW_COPY_AND_ASSIGN(PendingNotification); | 73 DISALLOW_COPY_AND_ASSIGN(PendingNotification); |
69 }; | 74 }; |
70 | 75 |
71 } // namespace content | 76 } // namespace content |
72 | 77 |
73 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ | 78 #endif // CONTENT_CHILD_NOTIFICATIONS_PENDING_NOTIFICATION_H_ |
OLD | NEW |