summaryrefslogtreecommitdiffstats
path: root/WebKit/android
diff options
context:
space:
mode:
Diffstat (limited to 'WebKit/android')
-rw-r--r--WebKit/android/jni/WebViewCore.cpp21
-rw-r--r--WebKit/android/jni/WebViewCore.h5
-rw-r--r--WebKit/android/plugins/PluginWidgetAndroid.cpp2
3 files changed, 22 insertions, 6 deletions
diff --git a/WebKit/android/jni/WebViewCore.cpp b/WebKit/android/jni/WebViewCore.cpp
index de85f19..8907794 100644
--- a/WebKit/android/jni/WebViewCore.cpp
+++ b/WebKit/android/jni/WebViewCore.cpp
@@ -1854,6 +1854,8 @@ void WebViewCore::notifyPluginsOnFrameLoad(const Frame* frame) {
SkANP::InitEvent(&event, kLifecycle_ANPEventType);
event.data.lifecycle.action = kOnLoad_ANPLifecycleAction;
sendPluginEvent(event);
+ // trigger the on/off screen notification if the page was reloaded
+ sendPluginVisibleScreen();
}
// else if frame's parent has completed
else if (!frame->tree()->parent()->loader()->isLoading()) {
@@ -1868,6 +1870,12 @@ void WebViewCore::notifyPluginsOnFrameLoad(const Frame* frame) {
SkANP::InitEvent(&event, kLifecycle_ANPEventType);
event.data.lifecycle.action = kOnLoad_ANPLifecycleAction;
(*iter)->sendEvent(event);
+
+ // trigger the on/off screen notification if the page was reloaded
+ ANPRectI visibleRect;
+ getVisibleScreen(visibleRect);
+ (*iter)->setVisibleScreen(visibleRect, m_scale);
+
break;
}
currentFrame = currentFrame->tree()->parent();
@@ -1876,6 +1884,14 @@ void WebViewCore::notifyPluginsOnFrameLoad(const Frame* frame) {
}
}
+void WebViewCore::getVisibleScreen(ANPRectI& visibleRect)
+{
+ visibleRect.left = m_scrollOffsetX;
+ visibleRect.top = m_scrollOffsetY;
+ visibleRect.right = m_scrollOffsetX + m_screenWidth;
+ visibleRect.bottom = m_scrollOffsetY + m_screenHeight;
+}
+
void WebViewCore::sendPluginVisibleScreen()
{
/* We may want to cache the previous values and only send the notification
@@ -1883,10 +1899,7 @@ void WebViewCore::sendPluginVisibleScreen()
*/
ANPRectI visibleRect;
- visibleRect.left = m_scrollOffsetX;
- visibleRect.top = m_scrollOffsetY;
- visibleRect.right = m_scrollOffsetX + m_screenWidth;
- visibleRect.bottom = m_scrollOffsetY + m_screenHeight;
+ getVisibleScreen(visibleRect);
PluginWidgetAndroid** iter = m_plugins.begin();
PluginWidgetAndroid** stop = m_plugins.end();
diff --git a/WebKit/android/jni/WebViewCore.h b/WebKit/android/jni/WebViewCore.h
index 4d1110f..161b046 100644
--- a/WebKit/android/jni/WebViewCore.h
+++ b/WebKit/android/jni/WebViewCore.h
@@ -444,9 +444,12 @@ namespace android {
// send the current screen size/zoom to all of the plugins in our list
void sendPluginVisibleScreen();
- // send onLoad event to plugins who are descendents of the given frame
+ // send onLoad event to plugins who are descendents of the given frame
void notifyPluginsOnFrameLoad(const Frame*);
+ // gets a rect representing the current on-screen portion of the document
+ void getVisibleScreen(ANPRectI&);
+
// send this event to all of the plugins in our list
void sendPluginEvent(const ANPEvent&);
diff --git a/WebKit/android/plugins/PluginWidgetAndroid.cpp b/WebKit/android/plugins/PluginWidgetAndroid.cpp
index b995f17..7c779c1 100644
--- a/WebKit/android/plugins/PluginWidgetAndroid.cpp
+++ b/WebKit/android/plugins/PluginWidgetAndroid.cpp
@@ -65,7 +65,7 @@ PluginWidgetAndroid::PluginWidgetAndroid(WebCore::PluginView* view)
m_pluginBounds.setEmpty();
m_hasFocus = false;
m_isFullScreen = false;
- m_visible = true;
+ m_visible = false;
m_zoomLevel = 0;
m_embeddedView = NULL;
m_embeddedViewAttached = false;