OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef PluginPlaceholderElement_h | 5 #ifndef PluginPlaceholderElement_h |
6 #define PluginPlaceholderElement_h | 6 #define PluginPlaceholderElement_h |
7 | 7 |
8 #include "core/dom/Element.h" | 8 #include "core/dom/Element.h" |
| 9 #include "core/html/HTMLButtonElement.h" |
9 #include "core/html/HTMLDivElement.h" | 10 #include "core/html/HTMLDivElement.h" |
| 11 #include "wtf/WeakPtr.h" |
10 | 12 |
11 namespace blink { | 13 namespace blink { |
12 | 14 |
13 class PluginPlaceholderElement final : public HTMLDivElement { | 15 class PluginPlaceholderElement final : public HTMLDivElement { |
14 DEFINE_WRAPPERTYPEINFO(); | 16 DEFINE_WRAPPERTYPEINFO(); |
15 public: | 17 public: |
16 static PassRefPtrWillBeRawPtr<PluginPlaceholderElement> create(Document&); | 18 static PassRefPtrWillBeRawPtr<PluginPlaceholderElement> create(Document& doc
ument) |
| 19 { |
| 20 RefPtrWillBeRawPtr<PluginPlaceholderElement> element = adoptRefWillBeNoo
p(new PluginPlaceholderElement(document)); |
| 21 element->initialize(); |
| 22 return element.release(); |
| 23 } |
| 24 |
| 25 ~PluginPlaceholderElement() override; |
| 26 void trace(Visitor*) override; |
17 | 27 |
18 void setMessage(const String&); | 28 void setMessage(const String&); |
19 void setIsCloseable(bool); | 29 void setIsCloseable(bool); |
20 | 30 |
21 private: | 31 private: |
22 explicit PluginPlaceholderElement(Document&); | 32 explicit PluginPlaceholderElement(Document&); |
| 33 |
| 34 void initialize(); |
| 35 PassRefPtr<EventListener> createSimpleEventListener(void(PluginPlaceholderEl
ement::*)()); |
| 36 |
| 37 void onCloseButtonClick(); |
| 38 |
| 39 WeakPtrFactory<PluginPlaceholderElement> m_weakPtrFactory; |
| 40 RefPtrWillBeMember<HTMLDivElement> m_messageElement; |
| 41 RefPtrWillBeMember<HTMLButtonElement> m_closeButton; |
23 }; | 42 }; |
24 | 43 |
25 } // namespace blink | 44 } // namespace blink |
26 | 45 |
27 #endif // PluginPlaceholderElement_h | 46 #endif // PluginPlaceholderElement_h |
OLD | NEW |