OLD | NEW |
1 /** | 1 /** |
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) | 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) |
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) | 3 * (C) 1999 Antti Koivisto (koivisto@kde.org) |
4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) | 4 * (C) 2000 Stefan Schimanski (1Stein@gmx.de) |
5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. | 5 * Copyright (C) 2004, 2005, 2006 Apple Computer, Inc. |
6 * | 6 * |
7 * This library is free software; you can redistribute it and/or | 7 * This library is free software; you can redistribute it and/or |
8 * modify it under the terms of the GNU Library General Public | 8 * modify it under the terms of the GNU Library General Public |
9 * License as published by the Free Software Foundation; either | 9 * License as published by the Free Software Foundation; either |
10 * version 2 of the License, or (at your option) any later version. | 10 * version 2 of the License, or (at your option) any later version. |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 } | 434 } |
435 | 435 |
436 NPObject* HTMLPlugInElement::getNPObject() | 436 NPObject* HTMLPlugInElement::getNPObject() |
437 { | 437 { |
438 ASSERT(document().frame()); | 438 ASSERT(document().frame()); |
439 if (!m_NPObject) | 439 if (!m_NPObject) |
440 m_NPObject = document().frame()->script().createScriptObjectForPluginEle
ment(this); | 440 m_NPObject = document().frame()->script().createScriptObjectForPluginEle
ment(this); |
441 return m_NPObject; | 441 return m_NPObject; |
442 } | 442 } |
443 | 443 |
| 444 void HTMLPlugInElement::setPluginFocus(bool focused) |
| 445 { |
| 446 Widget* focusedWidget = existingPluginWidget(); |
| 447 // NPAPI flash requires to receive messages when web contents focus changes. |
| 448 if (getNPObject() && focusedWidget) |
| 449 focusedWidget->setFocus(focused, WebFocusTypeNone); |
| 450 } |
| 451 |
444 bool HTMLPlugInElement::isImageType() | 452 bool HTMLPlugInElement::isImageType() |
445 { | 453 { |
446 if (m_serviceType.isEmpty() && protocolIs(m_url, "data")) | 454 if (m_serviceType.isEmpty() && protocolIs(m_url, "data")) |
447 m_serviceType = mimeTypeFromDataURL(m_url); | 455 m_serviceType = mimeTypeFromDataURL(m_url); |
448 | 456 |
449 if (LocalFrame* frame = document().frame()) { | 457 if (LocalFrame* frame = document().frame()) { |
450 KURL completedURL = document().completeURL(m_url); | 458 KURL completedURL = document().completeURL(m_url); |
451 return frame->loader().client()->objectContentType(completedURL, m_servi
ceType, shouldPreferPlugInsForImages()) == ObjectContentImage; | 459 return frame->loader().client()->objectContentType(completedURL, m_servi
ceType, shouldPreferPlugInsForImages()) == ObjectContentImage; |
452 } | 460 } |
453 | 461 |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
664 return hasAuthorShadowRoot(); | 672 return hasAuthorShadowRoot(); |
665 } | 673 } |
666 | 674 |
667 void HTMLPlugInElement::lazyReattachIfNeeded() | 675 void HTMLPlugInElement::lazyReattachIfNeeded() |
668 { | 676 { |
669 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) | 677 if (!useFallbackContent() && !usePlaceholderContent() && needsWidgetUpdate()
&& renderer() && !isImageType()) |
670 lazyReattachIfAttached(); | 678 lazyReattachIfAttached(); |
671 } | 679 } |
672 | 680 |
673 } | 681 } |
OLD | NEW |