From fcce71fa296bf3b42bfc978caa059c55ce8df998 Mon Sep 17 00:00:00 2001 From: Grace Kloba Date: Wed, 16 Dec 2009 11:39:26 -0800 Subject: Implement the full screen WebView plugin. Use a NoTitleBar_Fullscreen dialog to implement the full screen plugin. This runs in the same thread as WebView (UI in the Browser case). One catch is that the SurfaceView provided by the plugin needs to be opaque if it doesn't want to see through the WebView. The PluginFullScreenHolder translates the events to the underline WebView. Special treatment in the touch case as it needs to translate the coordinates. WebView can't be panned, or double tap to zoom, or long press to trigger the context menu while having a full screen plugin. Inside webkit, we also give the plugin element focus when it goes to the full screen so that it takes key events. While handling key events, we don't let it loose focus or scroll out. Todo: When a plugin goes to full screen, we should make sure the embedded plugin is fully visible. Otherwise when we translate the touch events back, they will be outside of the visible rect and will be ignored. This is part 2 of 2-project check in. --- WebKit/android/plugins/PluginWidgetAndroid.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'WebKit/android/plugins/PluginWidgetAndroid.cpp') diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp index f8862b2..cd7076d 100644 --- a/WebKit/android/plugins/PluginWidgetAndroid.cpp +++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp @@ -135,6 +135,10 @@ void PluginWidgetAndroid::setWindow(NPWindow* window, bool isTransparent) { m_embeddedView = env->NewGlobalRef(tempObj); } } + if (m_isFullScreen && m_pluginBounds != oldPluginBounds) { + m_core->updateFullScreenPlugin(docPoint.x(), docPoint.y(), + window->width, window->height); + } } else { m_flipPixelRef->safeUnref(); m_flipPixelRef = new SkFlipPixelRef(computeConfig(isTransparent), @@ -437,7 +441,10 @@ void PluginWidgetAndroid::requestFullScreen() { return; } - m_core->showFullScreenPlugin(m_webkitPlugin, m_pluginView->instance()); + IntPoint docPoint = frameToDocumentCoords(m_pluginWindow->x, m_pluginWindow->y); + m_core->showFullScreenPlugin(m_webkitPlugin, m_pluginView->instance(), + docPoint.x(), docPoint.y(), m_pluginWindow->width, + m_pluginWindow->height); m_isFullScreen = true; } -- cgit v1.1