equal
deleted
inserted
replaced
65 // might leave. |
65 // might leave. |
66 // ----------------------------------------------------------------------------- |
66 // ----------------------------------------------------------------------------- |
67 // |
67 // |
68 PluginWin::PluginWin(PluginSkin* pluginskin) |
68 PluginWin::PluginWin(PluginSkin* pluginskin) |
69 : m_pluginskin(pluginskin) |
69 : m_pluginskin(pluginskin) |
70 , m_windowedPlugin(true), m_fullscreen(false), m_windowCreated(false) |
70 , m_windowedPlugin(true), m_fullscreen(false), m_windowCreated(false), m_visibilty(false) |
71 { |
71 { |
72 } |
72 } |
73 |
73 |
74 // ----------------------------------------------------------------------------- |
74 // ----------------------------------------------------------------------------- |
75 // PluginWin::ConstructL |
75 // PluginWin::ConstructL |
96 // Deconstructor. |
96 // Deconstructor. |
97 // ----------------------------------------------------------------------------- |
97 // ----------------------------------------------------------------------------- |
98 // |
98 // |
99 PluginWin::~PluginWin() |
99 PluginWin::~PluginWin() |
100 { |
100 { |
|
101 CBrCtl* brCtl = control(m_pluginskin->frame()); |
|
102 if (brCtl) { |
|
103 WebView* view = brCtl->webView(); |
|
104 if (view) { |
|
105 int index = view->getVisiblePlugins().Find(m_pluginskin); |
|
106 if (index != KErrNotFound) |
|
107 view->getVisiblePlugins().Remove(index); |
|
108 } |
|
109 } |
101 |
110 |
102 TRAP_IGNORE( setPluginFocusL( EFalse ) ); |
111 TRAP_IGNORE( setPluginFocusL( EFalse ) ); |
103 |
112 |
104 // Remove the foreground observer |
113 // Remove the foreground observer |
105 ControlEnv()->RemoveForegroundObserver( *this ); |
114 ControlEnv()->RemoveForegroundObserver( *this ); |
382 if(visible) |
391 if(visible) |
383 HandleGainingForeground(); |
392 HandleGainingForeground(); |
384 else |
393 else |
385 HandleLosingForeground(); |
394 HandleLosingForeground(); |
386 } |
395 } |
|
396 |
|
397 WebView* view = control(m_pluginskin->frame())->webView(); |
|
398 int index = view->getVisiblePlugins().Find(m_pluginskin); |
|
399 if (visible && (m_visibilty != visible) && (index == KErrNotFound)) { |
|
400 view->getVisiblePlugins().AppendL(m_pluginskin); |
|
401 m_visibilty = visible; |
|
402 } |
|
403 else if (!visible && (index != KErrNotFound)) { |
|
404 view->getVisiblePlugins().Remove(index); |
|
405 m_visibilty = visible; |
|
406 } |
|
407 |
387 NotifyPluginVisible(visible); |
408 NotifyPluginVisible(visible); |
388 if (!m_windowedPlugin && m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->event) { |
409 if (!m_windowedPlugin && m_pluginskin->getNPPluginFucs() && m_pluginskin->getNPPluginFucs()->event) { |
389 NPEvent event; |
410 NPEvent event; |
390 NpEventVisibility ev; |
411 NpEventVisibility ev; |
391 event.event = ENppEventVisibility; |
412 event.event = ENppEventVisibility; |
831 } |
852 } |
832 } |
853 } |
833 return ret; |
854 return ret; |
834 |
855 |
835 } |
856 } |
|
857 |
|
858 bool PluginWin::containsPoint(WebView& view, const TPoint& pt) |
|
859 { |
|
860 if (m_control) { |
|
861 if (StaticObjectsContainer::instance()->isPluginFullscreen()) { |
|
862 return true; |
|
863 } |
|
864 else { |
|
865 TPoint point = pt; |
|
866 TPoint viewPos = view.PositionRelativeToScreen(); |
|
867 TPoint ctrlPos = m_control->PositionRelativeToScreen(); |
|
868 point += viewPos; |
|
869 return m_control->Rect().Contains(point - ctrlPos); |
|
870 } |
|
871 } |
|
872 else |
|
873 return false; |
|
874 } |