590 // Move/scroll window by aOffset and also sets the current cursor position |
590 // Move/scroll window by aOffset and also sets the current cursor position |
591 // ----------------------------------------------------------------------------- |
591 // ----------------------------------------------------------------------------- |
592 // |
592 // |
593 void PluginWin::moveWindow(const TPoint& aOffset) |
593 void PluginWin::moveWindow(const TPoint& aOffset) |
594 { |
594 { |
|
595 WebView *view = control(m_pluginskin->frame())->webView(); |
|
596 if(!view || view->isClosing()) |
|
597 return; |
595 // set force scroll to true, when plugin gives move command, |
598 // set force scroll to true, when plugin gives move command, |
596 // browser needs to move window according to offset value |
599 // browser needs to move window according to offset value |
597 m_forceScroll = ETrue; |
600 m_forceScroll = ETrue; |
598 // This plug-in has focus, so hide the Browser's cursor. The Plugin |
601 // This plug-in has focus, so hide the Browser's cursor. The Plugin |
599 // can display its own cursor, if it needs one. |
602 // can display its own cursor, if it needs one. |
600 |
603 |
601 WebFrame* mf = mainFrame(m_pluginskin->frame()); |
604 WebFrame* mf = mainFrame(m_pluginskin->frame()); |
602 WebCursor* c = StaticObjectsContainer::instance()->webCursor(); |
605 WebCursor* c = StaticObjectsContainer::instance()->webCursor(); |
603 if (c && mf && mf->frameView() && !m_pluginskin->pluginPlayer()) |
606 if (c && mf && mf->frameView() && !m_pluginskin->pluginPlayer()) |
604 { |
607 { |
605 // Offset sent by plugins doesn't take care of zoom level. Calculate currect offset value |
608 // Offset sent by plugins doesn't take care of zoom level. Calculate currect offset value |
606 WebView *view = control(m_pluginskin->frame())->webView(); |
|
607 TInt zoomlevel = view->zoomLevel(); |
609 TInt zoomlevel = view->zoomLevel(); |
608 TPoint oldPos(mf->frameView()->contentPos()); |
610 TPoint oldPos(mf->frameView()->contentPos()); |
609 TPoint newPos ((aOffset.iX * 100)/zoomlevel, (aOffset.iY * 100)/zoomlevel); |
611 TPoint newPos ((aOffset.iX * 100)/zoomlevel, (aOffset.iY * 100)/zoomlevel); |
610 c->offsetCursor( aOffset ); |
612 c->offsetCursor( aOffset ); |
611 mf->frameView()->scrollTo(oldPos + newPos); |
613 mf->frameView()->scrollTo(oldPos + newPos); |