Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1246)

Unified Diff: content/renderer/render_view.cc

Issue 7036019: Enabling page visibility api in the chrome browser. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Synced for commit. Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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.
« no previous file with comments | « content/renderer/render_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698