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 17 matching lines...) Expand all Loading... |
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/html/PluginDocument.h" | 34 #include "core/html/PluginDocument.h" |
35 | 35 |
36 #include "web/WebPluginContainerImpl.h" | 36 #include "web/WebPluginContainerImpl.h" |
37 | 37 |
38 #include "wtf/PassRefPtr.h" | 38 #include "platform/wtf/PassRefPtr.h" |
39 | 39 |
40 namespace blink { | 40 namespace blink { |
41 | 41 |
42 WebPlugin* WebPluginDocument::plugin() { | 42 WebPlugin* WebPluginDocument::plugin() { |
43 if (!isPluginDocument()) | 43 if (!isPluginDocument()) |
44 return 0; | 44 return 0; |
45 PluginDocument* doc = unwrap<PluginDocument>(); | 45 PluginDocument* doc = unwrap<PluginDocument>(); |
46 WebPluginContainerImpl* container = | 46 WebPluginContainerImpl* container = |
47 toWebPluginContainerImpl(doc->pluginView()); | 47 toWebPluginContainerImpl(doc->pluginView()); |
48 return container ? container->plugin() : 0; | 48 return container ? container->plugin() : 0; |
49 } | 49 } |
50 | 50 |
51 WebPluginDocument::WebPluginDocument(PluginDocument* elem) | 51 WebPluginDocument::WebPluginDocument(PluginDocument* elem) |
52 : WebDocument(elem) {} | 52 : WebDocument(elem) {} |
53 | 53 |
54 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, | 54 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, |
55 isDocumentNode() && | 55 isDocumentNode() && |
56 constUnwrap<Document>()->isPluginDocument()); | 56 constUnwrap<Document>()->isPluginDocument()); |
57 | 57 |
58 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { | 58 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { |
59 m_private = elem; | 59 m_private = elem; |
60 return *this; | 60 return *this; |
61 } | 61 } |
62 | 62 |
63 WebPluginDocument::operator PluginDocument*() const { | 63 WebPluginDocument::operator PluginDocument*() const { |
64 return static_cast<PluginDocument*>(m_private.get()); | 64 return static_cast<PluginDocument*>(m_private.get()); |
65 } | 65 } |
66 | 66 |
67 } // namespace blink | 67 } // namespace blink |
OLD | NEW |