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 * Copyright (C) 2008 Apple Inc. All rights reserved. | 3 * Copyright (C) 2008 Apple Inc. All rights reserved. |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Lesser General Public | 6 * modify it under the terms of the GNU Lesser General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 } | 47 } |
48 | 48 |
49 PassRefPtrWillBeRawPtr<DOMPlugin> DOMPluginArray::item(unsigned index) | 49 PassRefPtrWillBeRawPtr<DOMPlugin> DOMPluginArray::item(unsigned index) |
50 { | 50 { |
51 PluginData* data = pluginData(); | 51 PluginData* data = pluginData(); |
52 if (!data) | 52 if (!data) |
53 return nullptr; | 53 return nullptr; |
54 const Vector<PluginInfo>& plugins = data->plugins(); | 54 const Vector<PluginInfo>& plugins = data->plugins(); |
55 if (index >= plugins.size()) | 55 if (index >= plugins.size()) |
56 return nullptr; | 56 return nullptr; |
57 return DOMPlugin::create(data, m_frame, index).get(); | 57 return DOMPlugin::create(data, m_frame, index); |
58 } | 58 } |
59 | 59 |
60 bool DOMPluginArray::canGetItemsForName(const AtomicString& propertyName) | 60 bool DOMPluginArray::canGetItemsForName(const AtomicString& propertyName) |
61 { | 61 { |
62 PluginData* data = pluginData(); | 62 PluginData* data = pluginData(); |
63 if (!data) | 63 if (!data) |
64 return 0; | 64 return false; |
65 const Vector<PluginInfo>& plugins = data->plugins(); | 65 const Vector<PluginInfo>& plugins = data->plugins(); |
66 for (unsigned i = 0; i < plugins.size(); ++i) { | 66 for (unsigned i = 0; i < plugins.size(); ++i) { |
67 if (plugins[i].name == propertyName) | 67 if (plugins[i].name == propertyName) |
68 return true; | 68 return true; |
69 } | 69 } |
70 return false; | 70 return false; |
71 } | 71 } |
72 | 72 |
73 PassRefPtrWillBeRawPtr<DOMPlugin> DOMPluginArray::namedItem(const AtomicString&
propertyName) | 73 PassRefPtrWillBeRawPtr<DOMPlugin> DOMPluginArray::namedItem(const AtomicString&
propertyName) |
74 { | 74 { |
75 PluginData* data = pluginData(); | 75 PluginData* data = pluginData(); |
76 if (!data) | 76 if (!data) |
77 return nullptr; | 77 return nullptr; |
78 const Vector<PluginInfo>& plugins = data->plugins(); | 78 const Vector<PluginInfo>& plugins = data->plugins(); |
79 for (unsigned i = 0; i < plugins.size(); ++i) { | 79 for (unsigned i = 0; i < plugins.size(); ++i) { |
80 if (plugins[i].name == propertyName) | 80 if (plugins[i].name == propertyName) |
81 return DOMPlugin::create(data, m_frame, i).get(); | 81 return DOMPlugin::create(data, m_frame, i); |
82 } | 82 } |
83 return nullptr; | 83 return nullptr; |
84 } | 84 } |
85 | 85 |
86 void DOMPluginArray::refresh(bool reload) | 86 void DOMPluginArray::refresh(bool reload) |
87 { | 87 { |
88 if (!m_frame) | 88 if (!m_frame) |
89 return; | 89 return; |
90 Page::refreshPlugins(); | 90 Page::refreshPlugins(); |
91 if (reload) | 91 if (reload) |
92 m_frame->reload(NormalReload, ClientRedirect); | 92 m_frame->reload(NormalReload, ClientRedirect); |
93 } | 93 } |
94 | 94 |
95 PluginData* DOMPluginArray::pluginData() const | 95 PluginData* DOMPluginArray::pluginData() const |
96 { | 96 { |
97 if (!m_frame) | 97 if (!m_frame) |
98 return 0; | 98 return nullptr; |
99 Page* page = m_frame->page(); | 99 Page* page = m_frame->page(); |
100 if (!page) | 100 if (!page) |
101 return 0; | 101 return nullptr; |
102 return page->pluginData(); | 102 return page->pluginData(); |
103 } | 103 } |
104 | 104 |
105 } // namespace blink | 105 } // namespace blink |
OLD | NEW |