| 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 NotificationResourcesLoader_h | 5 #ifndef NotificationResourcesLoader_h |
| 6 #define NotificationResourcesLoader_h | 6 #define NotificationResourcesLoader_h |
| 7 | 7 |
| 8 #include "modules/ModulesExport.h" | 8 #include "modules/ModulesExport.h" |
| 9 #include "modules/notifications/NotificationImageLoader.h" | 9 #include "modules/notifications/NotificationImageLoader.h" |
| 10 #include "platform/heap/GarbageCollected.h" | 10 #include "platform/heap/GarbageCollected.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 std::unique_ptr<WebNotificationResources> getResources() const; | 49 std::unique_ptr<WebNotificationResources> getResources() const; |
| 50 | 50 |
| 51 // Stops every loader in |m_imageLoaders|. This is also used as the | 51 // Stops every loader in |m_imageLoaders|. This is also used as the |
| 52 // pre-finalizer. | 52 // pre-finalizer. |
| 53 void stop(); | 53 void stop(); |
| 54 | 54 |
| 55 DECLARE_VIRTUAL_TRACE(); | 55 DECLARE_VIRTUAL_TRACE(); |
| 56 | 56 |
| 57 private: | 57 private: |
| 58 void loadImage(ExecutionContext*, | 58 void loadImage(ExecutionContext*, |
| 59 NotificationImageLoader::Type, | |
| 60 const KURL&, | 59 const KURL&, |
| 61 std::unique_ptr<NotificationImageLoader::ImageCallback>); | 60 std::unique_ptr<NotificationImageLoader::ImageCallback>); |
| 62 void didLoadImage(const SkBitmap& image); | 61 void didLoadImage(const SkBitmap& image); |
| 63 void didLoadIcon(const SkBitmap& image); | 62 void didLoadIcon(const SkBitmap& image); |
| 64 void didLoadBadge(const SkBitmap& image); | 63 void didLoadBadge(const SkBitmap& image); |
| 65 void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); | 64 void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); |
| 66 | 65 |
| 67 // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if | 66 // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if |
| 68 // there are no more pending requests. | 67 // there are no more pending requests. |
| 69 void didFinishRequest(); | 68 void didFinishRequest(); |
| 70 | 69 |
| 71 bool m_started; | 70 bool m_started; |
| 72 std::unique_ptr<CompletionCallback> m_completionCallback; | 71 std::unique_ptr<CompletionCallback> m_completionCallback; |
| 73 int m_pendingRequestCount; | 72 int m_pendingRequestCount; |
| 74 HeapVector<Member<NotificationImageLoader>> m_imageLoaders; | 73 HeapVector<Member<NotificationImageLoader>> m_imageLoaders; |
| 75 SkBitmap m_image; | 74 SkBitmap m_image; |
| 76 SkBitmap m_icon; | 75 SkBitmap m_icon; |
| 77 SkBitmap m_badge; | 76 SkBitmap m_badge; |
| 78 Vector<SkBitmap> m_actionIcons; | 77 Vector<SkBitmap> m_actionIcons; |
| 79 }; | 78 }; |
| 80 | 79 |
| 81 } // namespace blink | 80 } // namespace blink |
| 82 | 81 |
| 83 #endif // NotificationResourcesLoader_h | 82 #endif // NotificationResourcesLoader_h |
| OLD | NEW |