PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(WebCore::Widget* widget)
{
    if (widget->isPluginView()) {
        PluginView* pluginView = static_cast<PluginView*>(widget);
        return pluginView->bindingInstance();
    }

    QWidget* platformWidget = widget->platformWidget();
    if (!platformWidget)
        return 0;
    return JSC::Bindings::QtInstance::getQtInstance(platformWidget, bindingRootObject(), QScriptEngine::QtOwnership);
}
Пример #2
0
PassRefPtr<JSC::Bindings::Instance> ScriptController::createScriptInstanceForWidget(Widget* widget)
{
    if (widget->isPluginView()) {
        PluginView* pluginView = static_cast<PluginView*>(widget);
        return pluginView->bindingInstance();
    }

#if ENABLE(CEHTML)
    if (widget->isEmbeddedWidget()) {
        EmbeddedWidget* embeddedWidget = static_cast<EmbeddedWidget*>(widget);

        Frame* frame= globalObject(mainThreadNormalWorld())->impl()->frame();
        return JSC::Bindings::BalInstance::getBalInstance(embeddedWidget, createRootObject(frame).get());
    }
#endif
    return 0;
}