OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2012 Apple Inc. All rights reserved. | 2 * Copyright (C) 2012 Apple Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
6 * are met: | 6 * are met: |
7 * | 7 * |
8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
(...skipping 16 matching lines...) Expand all Loading... |
27 */ | 27 */ |
28 | 28 |
29 #ifndef SVGImageChromeClient_h | 29 #ifndef SVGImageChromeClient_h |
30 #define SVGImageChromeClient_h | 30 #define SVGImageChromeClient_h |
31 | 31 |
32 #include "core/loader/EmptyClients.h" | 32 #include "core/loader/EmptyClients.h" |
33 #include "platform/graphics/ImageObserver.h" | 33 #include "platform/graphics/ImageObserver.h" |
34 | 34 |
35 namespace WebCore { | 35 namespace WebCore { |
36 | 36 |
37 class SVGImageChromeClient : public EmptyChromeClient { | 37 class SVGImageChromeClient FINAL : public EmptyChromeClient { |
38 WTF_MAKE_NONCOPYABLE(SVGImageChromeClient); WTF_MAKE_FAST_ALLOCATED; | 38 WTF_MAKE_NONCOPYABLE(SVGImageChromeClient); WTF_MAKE_FAST_ALLOCATED; |
39 public: | 39 public: |
40 SVGImageChromeClient(SVGImage* image) | 40 SVGImageChromeClient(SVGImage* image) |
41 : m_image(image) | 41 : m_image(image) |
42 { | 42 { |
43 } | 43 } |
44 | 44 |
45 virtual bool isSVGImageChromeClient() const { return true; } | 45 virtual bool isSVGImageChromeClient() const OVERRIDE { return true; } |
46 SVGImage* image() const { return m_image; } | 46 SVGImage* image() const { return m_image; } |
47 | 47 |
48 private: | 48 private: |
49 virtual void chromeDestroyed() | 49 virtual void chromeDestroyed() OVERRIDE |
50 { | 50 { |
51 m_image = 0; | 51 m_image = 0; |
52 } | 52 } |
53 | 53 |
54 virtual void invalidateContentsAndRootView(const IntRect& r) | 54 virtual void invalidateContentsAndRootView(const IntRect& r) OVERRIDE |
55 { | 55 { |
56 // If m_image->m_page is null, we're being destructed, don't fire change
dInRect() in that case. | 56 // If m_image->m_page is null, we're being destructed, don't fire change
dInRect() in that case. |
57 if (m_image && m_image->imageObserver() && m_image->m_page) | 57 if (m_image && m_image->imageObserver() && m_image->m_page) |
58 m_image->imageObserver()->changedInRect(m_image, r); | 58 m_image->imageObserver()->changedInRect(m_image, r); |
59 } | 59 } |
60 | 60 |
61 SVGImage* m_image; | 61 SVGImage* m_image; |
62 }; | 62 }; |
63 | 63 |
64 DEFINE_TYPE_CASTS(SVGImageChromeClient, ChromeClient, client, client->isSVGImage
ChromeClient(), client.isSVGImageChromeClient()); | 64 DEFINE_TYPE_CASTS(SVGImageChromeClient, ChromeClient, client, client->isSVGImage
ChromeClient(), client.isSVGImageChromeClient()); |
65 | 65 |
66 } | 66 } |
67 | 67 |
68 #endif // SVGImageChromeClient_h | 68 #endif // SVGImageChromeClient_h |
OLD | NEW |