pluginWidget->EndDrawPlugin(); }
nsresult nsPluginInstanceOwner::ScrollPositionDidChange(nsIScrollableView* aScrollable, nscoord aX, nscoord aY){#if defined(XP_MAC) || defined(XP_MACOSX)    if (mInstance)    {        nsCOMPtr<nsIPluginWidget> pluginWidget = do_QueryInterface(mWidget);        if (pluginWidget && NS_SUCCEEDED(pluginWidget->StartDrawPlugin()))        {          EventRecord scrollEvent;          InitializeEventRecord(&scrollEvent);          scrollEvent.what = nsPluginEventType_ScrollingEndsEvent;            nsPluginPort* pluginPort = FixUpPluginWindow(ePluginPaintEnable);          if (pluginPort)          {            nsPluginEvent pluginEvent = { &scrollEvent, nsPluginPlatformWindowRef(GetWindowFromPort(pluginPort->port)) };                PRBool eventHandled = PR_FALSE;            mInstance->HandleEvent(&pluginEvent, &eventHandled);#if defined(XP_MACOSX)            // we have to call SetWindow here to get RealPlayer to correctly update            // its position            mInstance->SetWindow(mPluginWindow);#else            if (!eventHandled) {                nsRect bogus(0,0,0,0);                Paint(bogus, 0);     // send an update event to the plugin            }#endif          }          pluginWidget->EndDrawPlugin();        }#if defined(XP_MACOSX)      // FIXME - Only invalidate the newly revealed amount.      mWidget->Invalidate(PR_TRUE);#endif    }#endif    StartTimer();    return NS_OK;}