OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 2000 Lars Knoll (knoll@kde.org) |
3 * (C) 2000 Antti Koivisto (koivisto@kde.org) | 3 * (C) 2000 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Dirk Mueller (mueller@kde.org) | 4 * (C) 2000 Dirk Mueller (mueller@kde.org) |
5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. | 5 * Copyright (C) 2003, 2005, 2006, 2007, 2008 Apple Inc. All rights reserved. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 13 matching lines...) Expand all Loading... |
24 #ifndef StyleFetchedImage_h | 24 #ifndef StyleFetchedImage_h |
25 #define StyleFetchedImage_h | 25 #define StyleFetchedImage_h |
26 | 26 |
27 #include "core/fetch/ImageResourceObserver.h" | 27 #include "core/fetch/ImageResourceObserver.h" |
28 #include "core/style/StyleImage.h" | 28 #include "core/style/StyleImage.h" |
29 #include "platform/weborigin/KURL.h" | 29 #include "platform/weborigin/KURL.h" |
30 | 30 |
31 namespace blink { | 31 namespace blink { |
32 | 32 |
33 class Document; | 33 class Document; |
34 class ImageResource; | |
35 | 34 |
36 class StyleFetchedImage final : public StyleImage, | 35 class StyleFetchedImage final : public StyleImage, |
37 public ImageResourceObserver { | 36 public ImageResourceObserver { |
38 USING_PRE_FINALIZER(StyleFetchedImage, dispose); | 37 USING_PRE_FINALIZER(StyleFetchedImage, dispose); |
39 | 38 |
40 public: | 39 public: |
41 static StyleFetchedImage* create(ImageResource* image, | 40 static StyleFetchedImage* create(ImageResourceContent* image, |
42 const Document& document, | 41 const Document& document, |
43 const KURL& url) { | 42 const KURL& url) { |
44 return new StyleFetchedImage(image, document, url); | 43 return new StyleFetchedImage(image, document, url); |
45 } | 44 } |
46 ~StyleFetchedImage() override; | 45 ~StyleFetchedImage() override; |
47 | 46 |
48 WrappedImagePtr data() const override; | 47 WrappedImagePtr data() const override; |
49 | 48 |
50 CSSValue* cssValue() const override; | 49 CSSValue* cssValue() const override; |
51 CSSValue* computedCSSValue() const override; | 50 CSSValue* computedCSSValue() const override; |
52 | 51 |
53 bool canRender() const override; | 52 bool canRender() const override; |
54 bool isLoaded() const override; | 53 bool isLoaded() const override; |
55 bool errorOccurred() const override; | 54 bool errorOccurred() const override; |
56 LayoutSize imageSize(const LayoutObject&, | 55 LayoutSize imageSize(const LayoutObject&, |
57 float multiplier, | 56 float multiplier, |
58 const LayoutSize& defaultObjectSize) const override; | 57 const LayoutSize& defaultObjectSize) const override; |
59 bool imageHasRelativeSize() const override; | 58 bool imageHasRelativeSize() const override; |
60 bool usesImageContainerSize() const override; | 59 bool usesImageContainerSize() const override; |
61 void addClient(LayoutObject*) override; | 60 void addClient(LayoutObject*) override; |
62 void removeClient(LayoutObject*) override; | 61 void removeClient(LayoutObject*) override; |
63 void imageNotifyFinished(ImageResource*) override; | 62 void imageNotifyFinished(ImageResourceContent*) override; |
64 String debugName() const override { return "StyleFetchedImage"; } | 63 String debugName() const override { return "StyleFetchedImage"; } |
65 PassRefPtr<Image> image(const LayoutObject&, | 64 PassRefPtr<Image> image(const LayoutObject&, |
66 const IntSize&, | 65 const IntSize&, |
67 float zoom) const override; | 66 float zoom) const override; |
68 bool knownToBeOpaque(const LayoutObject&) const override; | 67 bool knownToBeOpaque(const LayoutObject&) const override; |
69 ImageResource* cachedImage() const override; | 68 ImageResourceContent* cachedImage() const override; |
70 | 69 |
71 DECLARE_VIRTUAL_TRACE(); | 70 DECLARE_VIRTUAL_TRACE(); |
72 | 71 |
73 private: | 72 private: |
74 StyleFetchedImage(ImageResource*, const Document&, const KURL&); | 73 StyleFetchedImage(ImageResourceContent*, const Document&, const KURL&); |
75 | 74 |
76 void dispose(); | 75 void dispose(); |
77 | 76 |
78 Member<ImageResource> m_image; | 77 Member<ImageResourceContent> m_image; |
79 Member<const Document> m_document; | 78 Member<const Document> m_document; |
80 const KURL m_url; | 79 const KURL m_url; |
81 }; | 80 }; |
82 | 81 |
83 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImage, isImageResource()); | 82 DEFINE_STYLE_IMAGE_TYPE_CASTS(StyleFetchedImage, isImageResource()); |
84 | 83 |
85 } // namespace blink | 84 } // namespace blink |
86 #endif | 85 #endif |
OLD | NEW |