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

Unified Diff: Source/modules/screen_orientation/ScreenOrientation.cpp

Issue 398003002: Add start/stop listening Platform methods for Screen Orientation. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 5 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 | « no previous file | public/platform/Platform.h » ('j') | public/platform/Platform.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/modules/screen_orientation/ScreenOrientation.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp
index d8e40ed08b5a21b4b8042667a1b58c3352577fe7..05aefe438599e13ec765d731da48e9590d50108b 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp
@@ -14,6 +14,7 @@
#include "modules/EventTargetModules.h"
#include "modules/screen_orientation/LockOrientationCallback.h"
#include "modules/screen_orientation/ScreenOrientationController.h"
+#include "public/platform/Platform.h"
#include "public/platform/WebScreenOrientationType.h"
// This code assumes that WebScreenOrientationType values are included in WebScreenOrientationLockType.
@@ -107,10 +108,13 @@ ScreenOrientation::ScreenOrientation(LocalFrame* frame)
, m_angle(0)
{
ScriptWrappable::init(this);
+
+ blink::Platform::current()->startScreenOrientationListening();
}
ScreenOrientation::~ScreenOrientation()
{
+ blink::Platform::current()->stopScreenOrientationListening();
Michael van Ouwerkerk 2014/07/17 10:36:27 Shouldn't this also be called when page visibility
}
const WTF::AtomicString& ScreenOrientation::interfaceName() const
« no previous file with comments | « no previous file | public/platform/Platform.h » ('j') | public/platform/Platform.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698