OLD | NEW |
1 /* | 1 /* |
2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) | 2 Copyright (C) 2008 Nokia Corporation and/or its subsidiary(-ies) |
3 | 3 |
4 This library is free software; you can redistribute it and/or | 4 This library is free software; you can redistribute it and/or |
5 modify it under the terms of the GNU Library General Public | 5 modify it under the terms of the GNU Library General Public |
6 License as published by the Free Software Foundation; either | 6 License as published by the Free Software Foundation; either |
7 version 2 of the License, or (at your option) any later version. | 7 version 2 of the License, or (at your option) any later version. |
8 | 8 |
9 This library is distributed in the hope that it will be useful, | 9 This library is distributed in the hope that it will be useful, |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 but WITHOUT ANY WARRANTY; without even the implied warranty of |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 #include "core/dom/ContextLifecycleObserver.h" | 23 #include "core/dom/ContextLifecycleObserver.h" |
24 #include "modules/plugins/DOMMimeType.h" | 24 #include "modules/plugins/DOMMimeType.h" |
25 #include "platform/bindings/ScriptWrappable.h" | 25 #include "platform/bindings/ScriptWrappable.h" |
26 #include "platform/heap/Handle.h" | 26 #include "platform/heap/Handle.h" |
27 #include "platform/wtf/Forward.h" | 27 #include "platform/wtf/Forward.h" |
28 #include "platform/wtf/RefPtr.h" | 28 #include "platform/wtf/RefPtr.h" |
29 | 29 |
30 namespace blink { | 30 namespace blink { |
31 | 31 |
32 class PluginData; | |
33 | |
34 class DOMPlugin final : public GarbageCollectedFinalized<DOMPlugin>, | 32 class DOMPlugin final : public GarbageCollectedFinalized<DOMPlugin>, |
35 public ScriptWrappable, | 33 public ScriptWrappable, |
36 public ContextClient { | 34 public ContextClient { |
37 USING_GARBAGE_COLLECTED_MIXIN(DOMPlugin); | 35 USING_GARBAGE_COLLECTED_MIXIN(DOMPlugin); |
38 DEFINE_WRAPPERTYPEINFO(); | 36 DEFINE_WRAPPERTYPEINFO(); |
39 | 37 |
40 public: | 38 public: |
41 static DOMPlugin* Create(PluginData* plugin_data, | 39 static DOMPlugin* Create(LocalFrame* frame, const PluginInfo& plugin_info) { |
42 LocalFrame* frame, | 40 return new DOMPlugin(frame, plugin_info); |
43 unsigned index) { | |
44 return new DOMPlugin(plugin_data, frame, index); | |
45 } | 41 } |
46 virtual ~DOMPlugin(); | 42 virtual ~DOMPlugin(); |
47 | 43 |
48 String name() const; | 44 String name() const; |
49 String filename() const; | 45 String filename() const; |
50 String description() const; | 46 String description() const; |
51 | 47 |
52 unsigned length() const; | 48 unsigned length() const; |
53 | 49 |
54 DOMMimeType* item(unsigned index); | 50 DOMMimeType* item(unsigned index); |
55 DOMMimeType* namedItem(const AtomicString& property_name); | 51 DOMMimeType* namedItem(const AtomicString& property_name); |
56 | 52 |
57 DECLARE_VIRTUAL_TRACE(); | 53 DECLARE_VIRTUAL_TRACE(); |
58 | 54 |
59 private: | 55 private: |
60 DOMPlugin(PluginData*, LocalFrame*, unsigned index); | 56 DOMPlugin(LocalFrame*, const PluginInfo&); |
61 | 57 |
62 const PluginInfo& GetPluginInfo() const { | 58 Member<const PluginInfo> plugin_info_; |
63 return plugin_data_->Plugins()[index_]; | |
64 } | |
65 | |
66 RefPtr<PluginData> plugin_data_; | |
67 unsigned index_; | |
68 }; | 59 }; |
69 | 60 |
70 } // namespace blink | 61 } // namespace blink |
71 | 62 |
72 #endif // DOMPlugin_h | 63 #endif // DOMPlugin_h |
OLD | NEW |