Commit 4115f132 authored by shishir@chromium.org's avatar shishir@chromium.org

Enabling page visibility api in the chrome browser.


BUG=83286
TEST=None.


Review URL: http://codereview.chromium.org/7036019

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86569 0039d316-1c4b-4281-b951-d872f2087c98
parent 48ed7d97
......@@ -46,6 +46,7 @@
'ENABLE_OFFLINE_WEB_APPLICATIONS=1',
'ENABLE_OPENTYPE_SANITIZER=1',
'ENABLE_ORIENTATION_EVENTS=0',
'ENABLE_PAGE_VISIBILITY_API=1',
'ENABLE_PROGRESS_TAG=1',
'ENABLE_QUOTA=1',
'ENABLE_REQUEST_ANIMATION_FRAME=1',
......
......@@ -3878,6 +3878,7 @@ void RenderView::OnWasHidden() {
if (webview()) {
webview()->settings()->setMinimumTimerInterval(
webkit_glue::kBackgroundTabTimerInterval);
webview()->setVisibilityState(WebKit::WebPageVisibilityStateHidden, false);
}
#if defined(OS_MACOSX)
......@@ -3896,6 +3897,7 @@ void RenderView::OnWasRestored(bool needs_repainting) {
if (webview()) {
webview()->settings()->setMinimumTimerInterval(
webkit_glue::kForegroundTabTimerInterval);
webview()->setVisibilityState(WebKit::WebPageVisibilityStateVisible, false);
}
#if defined(OS_MACOSX)
......@@ -4096,6 +4098,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.
......
......@@ -35,6 +35,7 @@
#include "third_party/WebKit/Source/WebKit/chromium/public/WebFrameClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebIconURL.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNode.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebPageVisibilityState.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebTextDirection.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebViewClient.h"
#include "third_party/WebKit/Source/WebKit/chromium/public/WebNavigationType.h"
......@@ -428,6 +429,7 @@ class RenderView : public RenderWidget,
const WebKit::WebString& base_url,
const WebKit::WebString& url,
const WebKit::WebString& title);
virtual WebKit::WebPageVisibilityState visibilityState() const;
// WebKit::WebFrameClient implementation -------------------------------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment