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

Side by Side Diff: third_party/WebKit/Source/modules/notifications/NotificationResourcesLoader.h

Issue 2261283002: Add Notification images (Blink + desktop implementation) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Check IPC drawsNothing rather than isNull Created 4 years, 3 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 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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 std::unique_ptr<WebNotificationResources> getResources() const; 47 std::unique_ptr<WebNotificationResources> getResources() const;
48 48
49 // Stops every loader in |m_imageLoaders|. This is also used as the 49 // Stops every loader in |m_imageLoaders|. This is also used as the
50 // pre-finalizer. 50 // pre-finalizer.
51 void stop(); 51 void stop();
52 52
53 DECLARE_VIRTUAL_TRACE(); 53 DECLARE_VIRTUAL_TRACE();
54 54
55 private: 55 private:
56 void loadImage(ExecutionContext*, const KURL&, std::unique_ptr<NotificationI mageLoader::ImageCallback>); 56 void loadImage(ExecutionContext*, const KURL&, std::unique_ptr<NotificationI mageLoader::ImageCallback>);
57 void didLoadImage(const SkBitmap& image);
57 void didLoadIcon(const SkBitmap& image); 58 void didLoadIcon(const SkBitmap& image);
58 void didLoadBadge(const SkBitmap& image); 59 void didLoadBadge(const SkBitmap& image);
59 void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); 60 void didLoadActionIcon(size_t actionIndex, const SkBitmap& image);
60 61
61 // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if 62 // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if
62 // there are no more pending requests. 63 // there are no more pending requests.
63 void didFinishRequest(); 64 void didFinishRequest();
64 65
65 bool m_started; 66 bool m_started;
66 std::unique_ptr<CompletionCallback> m_completionCallback; 67 std::unique_ptr<CompletionCallback> m_completionCallback;
67 int m_pendingRequestCount; 68 int m_pendingRequestCount;
68 HeapVector<Member<NotificationImageLoader>> m_imageLoaders; 69 HeapVector<Member<NotificationImageLoader>> m_imageLoaders;
70 SkBitmap m_image;
69 SkBitmap m_icon; 71 SkBitmap m_icon;
70 SkBitmap m_badge; 72 SkBitmap m_badge;
71 Vector<SkBitmap> m_actionIcons; 73 Vector<SkBitmap> m_actionIcons;
72 }; 74 };
73 75
74 } // namespace blink 76 } // namespace blink
75 77
76 #endif // NotificationResourcesLoader_h 78 #endif // NotificationResourcesLoader_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698