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

Unified Diff: third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp

Issue 1631063002: Add isPageVisible to Page (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@my-origin
Patch Set: Remove unnecessary variable Created 4 years, 11 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
Index: third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp
diff --git a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp
index bb3ad3ce0ea4ed344752cca89033acb72b673b65..efad7b6130d2456f103c910f6ffaa2c0962d5815 100644
--- a/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp
+++ b/third_party/WebKit/Source/modules/gamepad/NavigatorGamepad.cpp
@@ -220,7 +220,7 @@ static bool isGamepadEvent(const AtomicString& eventType)
void NavigatorGamepad::didAddEventListener(LocalDOMWindow*, const AtomicString& eventType)
{
if (isGamepadEvent(eventType)) {
- if (page() && page()->visibilityState() == PageVisibilityStateVisible)
+ if (page() && page()->isPageVisible())
startUpdatingIfAttached();
m_hasEventListener = true;
}
@@ -250,7 +250,7 @@ void NavigatorGamepad::didRemoveGamepadEventListeners()
void NavigatorGamepad::pageVisibilityChanged()
{
// Inform the embedder whether it needs to provide gamepad data for us.
- bool visible = page()->visibilityState() == PageVisibilityStateVisible;
+ bool visible = page()->isPageVisible();
if (visible && (m_hasEventListener || m_gamepads))
startUpdatingIfAttached();
else
« no previous file with comments | « third_party/WebKit/Source/core/page/Page.cpp ('k') | third_party/WebKit/Source/modules/geolocation/GeolocationController.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698