| 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, | 
|  59                  const KURL&, |  60                  const KURL&, | 
|  60                  std::unique_ptr<NotificationImageLoader::ImageCallback>); |  61                  std::unique_ptr<NotificationImageLoader::ImageCallback>); | 
|  61   void didLoadImage(const SkBitmap& image); |  62   void didLoadImage(const SkBitmap& image); | 
|  62   void didLoadIcon(const SkBitmap& image); |  63   void didLoadIcon(const SkBitmap& image); | 
|  63   void didLoadBadge(const SkBitmap& image); |  64   void didLoadBadge(const SkBitmap& image); | 
|  64   void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); |  65   void didLoadActionIcon(size_t actionIndex, const SkBitmap& image); | 
|  65  |  66  | 
|  66   // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if |  67   // Decrements |m_pendingRequestCount| and runs |m_completionCallback| if | 
|  67   // there are no more pending requests. |  68   // there are no more pending requests. | 
|  68   void didFinishRequest(); |  69   void didFinishRequest(); | 
|  69  |  70  | 
|  70   bool m_started; |  71   bool m_started; | 
|  71   std::unique_ptr<CompletionCallback> m_completionCallback; |  72   std::unique_ptr<CompletionCallback> m_completionCallback; | 
|  72   int m_pendingRequestCount; |  73   int m_pendingRequestCount; | 
|  73   HeapVector<Member<NotificationImageLoader>> m_imageLoaders; |  74   HeapVector<Member<NotificationImageLoader>> m_imageLoaders; | 
|  74   SkBitmap m_image; |  75   SkBitmap m_image; | 
|  75   SkBitmap m_icon; |  76   SkBitmap m_icon; | 
|  76   SkBitmap m_badge; |  77   SkBitmap m_badge; | 
|  77   Vector<SkBitmap> m_actionIcons; |  78   Vector<SkBitmap> m_actionIcons; | 
|  78 }; |  79 }; | 
|  79  |  80  | 
|  80 }  // namespace blink |  81 }  // namespace blink | 
|  81  |  82  | 
|  82 #endif  // NotificationResourcesLoader_h |  83 #endif  // NotificationResourcesLoader_h | 
| OLD | NEW |