summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/plugins/PluginView.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/plugins/PluginView.cpp47
1 files changed, 37 insertions, 10 deletions
diff --git a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
index 28572a45cf..d69f8a731d 100644
--- a/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
+++ b/src/3rdparty/webkit/WebCore/plugins/PluginView.cpp
@@ -53,6 +53,7 @@
#include "JSDOMBinding.h"
#include "ScriptController.h"
#include "ScriptValue.h"
+#include "SecurityOrigin.h"
#include "PluginDatabase.h"
#include "PluginDebug.h"
#include "PluginMainThreadScheduler.h"
@@ -123,12 +124,12 @@ void PluginView::setFrameRect(const IntRect& rect)
updatePluginWidget();
-#if PLATFORM(WIN_OS)
- // On Windows, always call plugin to change geometry.
+#if PLATFORM(WIN_OS) || PLATFORM(SYMBIAN)
+ // On Windows and Symbian, always call plugin to change geometry.
setNPWindowRect(rect);
#elif XP_UNIX
- // On Unix, only call plugin if it's full-page.
- if (m_mode == NP_FULL)
+ // On Unix, multiple calls to setNPWindow() in windowed mode causes Flash to crash
+ if (m_mode == NP_FULL || !m_isWindowed)
setNPWindowRect(rect);
#endif
}
@@ -147,6 +148,12 @@ void PluginView::handleEvent(Event* event)
handleMouseEvent(static_cast<MouseEvent*>(event));
else if (event->isKeyboardEvent())
handleKeyboardEvent(static_cast<KeyboardEvent*>(event));
+#if defined(Q_WS_X11) && ENABLE(NETSCAPE_PLUGIN_API)
+ else if (event->type() == eventNames().DOMFocusOutEvent)
+ handleFocusOutEvent();
+ else if (event->type() == eventNames().DOMFocusInEvent)
+ handleFocusInEvent();
+#endif
}
void PluginView::init()
@@ -234,7 +241,13 @@ bool PluginView::start()
if (!platformStart())
m_status = PluginStatusCanNotLoadPlugin;
- return (m_status == PluginStatusLoadedSuccessfully);
+ if (m_status != PluginStatusLoadedSuccessfully)
+ return false;
+
+ if (parentFrame()->page())
+ parentFrame()->page()->didStartPlugin(this);
+
+ return true;
}
PluginView::~PluginView()
@@ -274,6 +287,9 @@ void PluginView::stop()
if (!m_isStarted)
return;
+ if (parentFrame()->page())
+ parentFrame()->page()->didStopPlugin(this);
+
LOG(Plugins, "PluginView::stop(): Stopping plug-in '%s'", m_plugin->name().utf8().data());
HashSet<RefPtr<PluginStream> > streams = m_streams;
@@ -378,7 +394,7 @@ static bool getString(ScriptController* proxy, JSValue result, String& string)
return false;
JSLock lock(JSC::SilenceAssertionsOnly);
- ExecState* exec = proxy->globalObject()->globalExec();
+ ExecState* exec = proxy->globalObject(pluginWorld())->globalExec();
UString ustring = result.toString(exec);
exec->clearException();
@@ -434,7 +450,7 @@ void PluginView::performRequest(PluginRequest* request)
// Executing a script can cause the plugin view to be destroyed, so we keep a reference to the parent frame.
RefPtr<Frame> parentFrame = m_parentFrame;
- JSValue result = m_parentFrame->loader()->executeScript(jsString, request->shouldAllowPopups()).jsValue();
+ JSValue result = m_parentFrame->script()->executeScript(jsString, request->shouldAllowPopups()).jsValue();
if (targetFrameName.isNull()) {
String resultString;
@@ -501,9 +517,8 @@ NPError PluginView::load(const FrameLoadRequest& frameLoadRequest, bool sendNoti
// For security reasons, only allow JS requests to be made on the frame that contains the plug-in.
if (!targetFrameName.isNull() && m_parentFrame->tree()->find(targetFrameName) != m_parentFrame)
return NPERR_INVALID_PARAM;
- } else if (!FrameLoader::canLoad(url, String(), m_parentFrame->document())) {
+ } else if (!SecurityOrigin::canLoad(url, String(), m_parentFrame->document()))
return NPERR_GENERIC_ERROR;
- }
PluginRequest* request = new PluginRequest(frameLoadRequest, sendNotification, notifyData, arePopupsAllowed());
scheduleRequest(request);
@@ -803,12 +818,18 @@ PluginView::PluginView(Frame* parentFrame, const IntSize& size, PluginPackage* p
, m_drawingModel(NPDrawingModel(-1))
, m_eventModel(NPEventModel(-1))
#endif
-#if defined(Q_WS_X11)
+#if defined(Q_WS_X11) && ENABLE(NETSCAPE_PLUGIN_API)
, m_hasPendingGeometryChange(false)
+ , m_drawable(0)
+ , m_visual(0)
+ , m_colormap(0)
+ , m_pluginDisplay(0)
#endif
, m_loadManually(loadManually)
, m_manualStream(0)
, m_isJavaScriptPaused(false)
+ , m_isHalted(false)
+ , m_hasBeenHalted(false)
{
if (!m_plugin) {
m_status = PluginStatusCanNotFindPlugin;
@@ -1214,4 +1235,10 @@ const char* PluginView::userAgentStatic()
}
#endif
+
+Node* PluginView::node() const
+{
+ return m_element;
+}
+
} // namespace WebCore