OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2010 Google Inc. All rights reserved. | 2 * Copyright (C) 2010 Google 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 are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * 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 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 13 matching lines...) Expand all Loading... |
24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, | 24 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, |
25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | 25 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY |
26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | 26 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
29 */ | 29 */ |
30 | 30 |
31 #include "public/web/WebPluginDocument.h" | 31 #include "public/web/WebPluginDocument.h" |
32 | 32 |
33 #include "core/dom/Document.h" | 33 #include "core/dom/Document.h" |
34 #include "core/exported/WebPluginContainerBase.h" | |
35 #include "core/html/PluginDocument.h" | 34 #include "core/html/PluginDocument.h" |
| 35 |
| 36 #include "web/WebPluginContainerImpl.h" |
| 37 |
36 #include "platform/wtf/PassRefPtr.h" | 38 #include "platform/wtf/PassRefPtr.h" |
37 | 39 |
38 namespace blink { | 40 namespace blink { |
39 | 41 |
40 WebPlugin* WebPluginDocument::Plugin() { | 42 WebPlugin* WebPluginDocument::Plugin() { |
41 if (!IsPluginDocument()) | 43 if (!IsPluginDocument()) |
42 return 0; | 44 return 0; |
43 PluginDocument* doc = Unwrap<PluginDocument>(); | 45 PluginDocument* doc = Unwrap<PluginDocument>(); |
44 WebPluginContainerBase* container = | 46 WebPluginContainerImpl* container = |
45 ToWebPluginContainerBase(doc->GetPluginView()); | 47 ToWebPluginContainerImpl(doc->GetPluginView()); |
46 return container ? container->Plugin() : nullptr; | 48 return container ? container->Plugin() : 0; |
47 } | 49 } |
48 | 50 |
49 WebPluginDocument::WebPluginDocument(PluginDocument* elem) | 51 WebPluginDocument::WebPluginDocument(PluginDocument* elem) |
50 : WebDocument(elem) {} | 52 : WebDocument(elem) {} |
51 | 53 |
52 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, | 54 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, |
53 IsDocumentNode() && | 55 IsDocumentNode() && |
54 ConstUnwrap<Document>()->IsPluginDocument()); | 56 ConstUnwrap<Document>()->IsPluginDocument()); |
55 | 57 |
56 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { | 58 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { |
57 private_ = elem; | 59 private_ = elem; |
58 return *this; | 60 return *this; |
59 } | 61 } |
60 | 62 |
61 WebPluginDocument::operator PluginDocument*() const { | 63 WebPluginDocument::operator PluginDocument*() const { |
62 return static_cast<PluginDocument*>(private_.Get()); | 64 return static_cast<PluginDocument*>(private_.Get()); |
63 } | 65 } |
64 | 66 |
65 } // namespace blink | 67 } // namespace blink |
OLD | NEW |