OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 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 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 void WebPluginContainerImpl::setParent(Widget* widget) | 263 void WebPluginContainerImpl::setParent(Widget* widget) |
264 { | 264 { |
265 // We override this function so that if the plugin is windowed, we can call | 265 // We override this function so that if the plugin is windowed, we can call |
266 // NPP_SetWindow at the first possible moment. This ensures that | 266 // NPP_SetWindow at the first possible moment. This ensures that |
267 // NPP_SetWindow is called before the manual load data is sent to a plugin. | 267 // NPP_SetWindow is called before the manual load data is sent to a plugin. |
268 // If this order is reversed, Flash won't load videos. | 268 // If this order is reversed, Flash won't load videos. |
269 | 269 |
270 Widget::setParent(widget); | 270 Widget::setParent(widget); |
271 if (widget) | 271 if (widget) |
272 reportGeometry(); | 272 reportGeometry(); |
| 273 else if (m_webPlugin) |
| 274 m_webPlugin->containerDidDetachFromParent(); |
273 } | 275 } |
274 | 276 |
275 void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) | 277 void WebPluginContainerImpl::setPlugin(WebPlugin* plugin) |
276 { | 278 { |
277 if (plugin != m_webPlugin) { | 279 if (plugin != m_webPlugin) { |
278 m_element->resetInstance(); | 280 m_element->resetInstance(); |
279 m_webPlugin = plugin; | 281 m_webPlugin = plugin; |
280 } | 282 } |
281 } | 283 } |
282 | 284 |
(...skipping 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
908 if (m_element->renderer()->document().renderer()) { | 910 if (m_element->renderer()->document().renderer()) { |
909 // Take our element and get the clip rect from the enclosing layer and | 911 // Take our element and get the clip rect from the enclosing layer and |
910 // frame view. | 912 // frame view. |
911 clipRect.intersect( | 913 clipRect.intersect( |
912 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); | 914 m_element->document().view()->windowClipRectForFrameOwner(m_element)
); |
913 } | 915 } |
914 | 916 |
915 return clipRect; | 917 return clipRect; |
916 } | 918 } |
917 | 919 |
| 920 bool WebPluginContainerImpl::pluginShouldPersist() const |
| 921 { |
| 922 return m_webPlugin->shouldPersist(); |
| 923 } |
| 924 |
918 } // namespace blink | 925 } // namespace blink |
OLD | NEW |