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

Unified Diff: Source/modules/screen_orientation/ScreenOrientationController.h

Issue 280283002: Stop firing orientationchange events at pages that are not visible (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase now that dependency patch has landed Created 6 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
Index: Source/modules/screen_orientation/ScreenOrientationController.h
diff --git a/Source/modules/screen_orientation/ScreenOrientationController.h b/Source/modules/screen_orientation/ScreenOrientationController.h
index 5bc56f45f991c8450fbd150323310d990e5c08ec..5c5b571c91073d290f2345978749de3c6bcbb626 100644
--- a/Source/modules/screen_orientation/ScreenOrientationController.h
+++ b/Source/modules/screen_orientation/ScreenOrientationController.h
@@ -6,13 +6,14 @@
#define ScreenOrientationController_h
#include "core/dom/DocumentSupplementable.h"
+#include "core/page/PageLifecycleObserver.h"
#include "public/platform/WebScreenOrientationType.h"
namespace WebCore {
class FrameView;
-class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<ScreenOrientationController>, public DocumentSupplement {
+class ScreenOrientationController FINAL : public NoBaseWillBeGarbageCollected<ScreenOrientationController>, public DocumentSupplement, public PageLifecycleObserver {
WILL_BE_USING_GARBAGE_COLLECTED_MIXIN(ScreenOrientationController);
public:
virtual ~ScreenOrientationController();
@@ -27,7 +28,11 @@ private:
explicit ScreenOrientationController(Document&);
static blink::WebScreenOrientationType computeOrientation(FrameView*);
+ // Inherited from PageLifecycleObserver.
+ virtual void pageVisibilityChanged() OVERRIDE;
+
Document& m_document;
+ blink::WebScreenOrientationType m_lastVisibleOrientation;
mlamouri (slow - plz ping) 2014/05/28 14:05:33 Hmm, with your current implementation, this ought
Inactive 2014/05/28 15:27:28 Done.
};
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698