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

Unified Diff: Source/core/frame/DeviceSensorEventController.cpp

Issue 306363002: Gamepad: honor page visibility (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: just a comment that it will be better with Oilpan Created 6 years, 6 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 | « Source/core/frame/DeviceSensorEventController.h ('k') | Source/modules/gamepad/NavigatorGamepad.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/frame/DeviceSensorEventController.cpp
diff --git a/Source/core/frame/DeviceSensorEventController.cpp b/Source/core/frame/DeviceSensorEventController.cpp
index 5ffa369be494a6bdd700d4b41f8cc5081b5fb6bf..f128a4e426f102a44111172d5100d285a9a69301 100644
--- a/Source/core/frame/DeviceSensorEventController.cpp
+++ b/Source/core/frame/DeviceSensorEventController.cpp
@@ -101,12 +101,9 @@ void DeviceSensorEventController::stopUpdating()
void DeviceSensorEventController::pageVisibilityChanged()
{
- if (!m_hasEventListener)
- return;
-
- if (page()->visibilityState() == PageVisibilityStateVisible)
+ if (page()->visibilityState() == PageVisibilityStateVisible && m_hasEventListener)
startUpdating();
- else
+ else if (page()->visibilityState() == PageVisibilityStateHidden)
stopUpdating();
}
« no previous file with comments | « Source/core/frame/DeviceSensorEventController.h ('k') | Source/modules/gamepad/NavigatorGamepad.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698