| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef PluginPlaceholderImpl_h | |
| 6 #define PluginPlaceholderImpl_h | |
| 7 | |
| 8 #include "core/plugins/PluginPlaceholder.h" | |
| 9 #include "platform/heap/Handle.h" | |
| 10 #include "platform/heap/Visitor.h" | |
| 11 #include "wtf/Assertions.h" | |
| 12 #include "wtf/OwnPtr.h" | |
| 13 #include "wtf/PassOwnPtr.h" | |
| 14 | |
| 15 namespace blink { | |
| 16 | |
| 17 class Document; | |
| 18 class PluginPlaceholderElement; | |
| 19 class WebPluginPlaceholder; | |
| 20 | |
| 21 // Populates a plugin placeholder element with content supplied by the embedder. | |
| 22 // Intended to be loaded into a user agent shadow root, but will accept any | |
| 23 // container. Owns a WebPluginPlaceholder instance. | |
| 24 class PluginPlaceholderImpl : public NoBaseWillBeGarbageCollectedFinalized<Plugi
nPlaceholderImpl>, public PluginPlaceholder { | |
| 25 WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(PluginPlaceholderImpl); | |
| 26 public: | |
| 27 static PassOwnPtrWillBeRawPtr<PluginPlaceholderImpl> create(PassOwnPtr<WebPl
uginPlaceholder> webPluginPlaceholder, Document& document) | |
| 28 { | |
| 29 ASSERT(webPluginPlaceholder); | |
| 30 return adoptPtrWillBeNoop(new PluginPlaceholderImpl(webPluginPlaceholder
, document)); | |
| 31 } | |
| 32 | |
| 33 #if ENABLE(OILPAN) | |
| 34 ~PluginPlaceholderImpl(); | |
| 35 #else | |
| 36 ~PluginPlaceholderImpl() override; | |
| 37 #endif | |
| 38 | |
| 39 DECLARE_VIRTUAL_TRACE(); | |
| 40 | |
| 41 // PluginPlaceholder methods | |
| 42 void loadIntoContainer(ContainerNode&) override; | |
| 43 | |
| 44 // Visible for testing. | |
| 45 WebPluginPlaceholder* webPluginPlaceholder() const { return m_webPluginPlace
holder.get(); } | |
| 46 | |
| 47 private: | |
| 48 PluginPlaceholderImpl(PassOwnPtr<WebPluginPlaceholder>, Document&); | |
| 49 | |
| 50 // Update the placeholder element with fresh content. | |
| 51 void update(); | |
| 52 | |
| 53 OwnPtr<WebPluginPlaceholder> m_webPluginPlaceholder; | |
| 54 RefPtrWillBeMember<PluginPlaceholderElement> m_placeholderElement; | |
| 55 }; | |
| 56 | |
| 57 } // namespace blink | |
| 58 | |
| 59 #endif // PluginPlaceholderImpl_h | |
| OLD | NEW |