| 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" |
| 34 #include "core/html/PluginDocument.h" | 35 #include "core/html/PluginDocument.h" |
| 35 | |
| 36 #include "web/WebPluginContainerImpl.h" | |
| 37 | |
| 38 #include "platform/wtf/PassRefPtr.h" | 36 #include "platform/wtf/PassRefPtr.h" |
| 39 | 37 |
| 40 namespace blink { | 38 namespace blink { |
| 41 | 39 |
| 42 WebPlugin* WebPluginDocument::Plugin() { | 40 WebPlugin* WebPluginDocument::Plugin() { |
| 43 if (!IsPluginDocument()) | 41 if (!IsPluginDocument()) |
| 44 return 0; | 42 return 0; |
| 45 PluginDocument* doc = Unwrap<PluginDocument>(); | 43 PluginDocument* doc = Unwrap<PluginDocument>(); |
| 46 WebPluginContainerImpl* container = | 44 WebPluginContainerBase* container = |
| 47 ToWebPluginContainerImpl(doc->GetPluginView()); | 45 ToWebPluginContainerBase(doc->GetPluginView()); |
| 48 return container ? container->Plugin() : 0; | 46 return container ? container->Plugin() : nullptr; |
| 49 } | 47 } |
| 50 | 48 |
| 51 WebPluginDocument::WebPluginDocument(PluginDocument* elem) | 49 WebPluginDocument::WebPluginDocument(PluginDocument* elem) |
| 52 : WebDocument(elem) {} | 50 : WebDocument(elem) {} |
| 53 | 51 |
| 54 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, | 52 DEFINE_WEB_NODE_TYPE_CASTS(WebPluginDocument, |
| 55 IsDocumentNode() && | 53 IsDocumentNode() && |
| 56 ConstUnwrap<Document>()->IsPluginDocument()); | 54 ConstUnwrap<Document>()->IsPluginDocument()); |
| 57 | 55 |
| 58 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { | 56 WebPluginDocument& WebPluginDocument::operator=(PluginDocument* elem) { |
| 59 private_ = elem; | 57 private_ = elem; |
| 60 return *this; | 58 return *this; |
| 61 } | 59 } |
| 62 | 60 |
| 63 WebPluginDocument::operator PluginDocument*() const { | 61 WebPluginDocument::operator PluginDocument*() const { |
| 64 return static_cast<PluginDocument*>(private_.Get()); | 62 return static_cast<PluginDocument*>(private_.Get()); |
| 65 } | 63 } |
| 66 | 64 |
| 67 } // namespace blink | 65 } // namespace blink |
| OLD | NEW |