Index: content/renderer/render_view.cc |
diff --git a/content/renderer/render_view.cc b/content/renderer/render_view.cc |
index caf265d27c23868a79f3ec3ece6192ea65dbfcba..dac0abae99bbb422ab00969228402b7f33c63b17 100644 |
--- a/content/renderer/render_view.cc |
+++ b/content/renderer/render_view.cc |
@@ -3888,6 +3888,7 @@ void RenderView::OnWasHidden() { |
if (webview()) { |
webview()->settings()->setMinimumTimerInterval( |
webkit_glue::kBackgroundTabTimerInterval); |
+ webview()->setVisibilityState(WebKit::WebPageVisibilityStateHidden, false); |
} |
#if defined(OS_MACOSX) |
@@ -3906,6 +3907,7 @@ void RenderView::OnWasRestored(bool needs_repainting) { |
if (webview()) { |
webview()->settings()->setMinimumTimerInterval( |
webkit_glue::kForegroundTabTimerInterval); |
+ webview()->setVisibilityState(WebKit::WebPageVisibilityStateVisible, false); |
} |
#if defined(OS_MACOSX) |
@@ -4106,6 +4108,13 @@ void RenderView::registerProtocolHandler(const WebString& scheme, |
title)); |
} |
+WebKit::WebPageVisibilityState RenderView::visibilityState() const { |
+ if (is_hidden()) |
+ return WebKit::WebPageVisibilityStateHidden; |
+ else |
+ return WebKit::WebPageVisibilityStateVisible; |
+} |
+ |
bool RenderView::IsNonLocalTopLevelNavigation( |
const GURL& url, WebKit::WebFrame* frame, WebKit::WebNavigationType type) { |
// Must be a top level frame. |