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

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

Issue 319633007: Move WebScreenOrientationClient to WebFrameClient. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: m_client null check 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
Index: Source/modules/screen_orientation/ScreenOrientation.cpp
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp
index 211395523adad830d18c349b1b49c5fa393864fe..413edd69d5fc78d11bf998a415fac64e84c88c8d 100644
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp
@@ -13,7 +13,6 @@
#include "core/frame/DOMWindow.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/Screen.h"
-#include "core/page/Page.h"
#include "modules/screen_orientation/LockOrientationCallback.h"
#include "modules/screen_orientation/ScreenOrientationController.h"
#include "public/platform/WebScreenOrientationType.h"
@@ -101,13 +100,6 @@ Document* ScreenOrientation::document() const
return m_associatedDOMWindow->document();
}
-Page* ScreenOrientation::page() const
-{
- if (!frame())
- return 0;
- return frame()->page();
-}
-
ScreenOrientation& ScreenOrientation::from(Screen& screen)
{
ScreenOrientation* supplement = static_cast<ScreenOrientation*>(WillBeHeapSupplement<Screen>::from(screen, supplementName()));
@@ -125,11 +117,11 @@ ScreenOrientation::~ScreenOrientation()
const AtomicString& ScreenOrientation::orientation(Screen& screen)
{
ScreenOrientation& screenOrientation = ScreenOrientation::from(screen);
- if (!screenOrientation.page()) {
+ if (!screenOrientation.frame()) {
// FIXME: we should try to return a better guess, like the latest known value.
return orientationTypeToString(blink::WebScreenOrientationPortraitPrimary);
}
- ScreenOrientationController& controller = ScreenOrientationController::from(*screenOrientation.page());
+ ScreenOrientationController& controller = ScreenOrientationController::from(*screenOrientation.frame());
return orientationTypeToString(controller.orientation());
}
@@ -141,7 +133,7 @@ ScriptPromise ScreenOrientation::lockOrientation(ScriptState* state, Screen& scr
ScreenOrientation& screenOrientation = ScreenOrientation::from(screen);
Document* document = screenOrientation.document();
- if (!document || !screenOrientation.page()) {
+ if (!document || !screenOrientation.frame()) {
RefPtrWillBeRawPtr<DOMException> exception = DOMException::create(InvalidStateError, "The object is no longer associated to a document.");
resolver->reject(exception);
return promise;
@@ -153,17 +145,17 @@ ScriptPromise ScreenOrientation::lockOrientation(ScriptState* state, Screen& scr
return promise;
}
- ScreenOrientationController::from(*screenOrientation.page()).lockOrientation(stringToOrientationLock(lockString), new LockOrientationCallback(resolver));
+ ScreenOrientationController::from(*screenOrientation.frame()).lockOrientation(stringToOrientationLock(lockString), new LockOrientationCallback(resolver));
return promise;
}
void ScreenOrientation::unlockOrientation(Screen& screen)
{
ScreenOrientation& screenOrientation = ScreenOrientation::from(screen);
- if (!screenOrientation.page())
+ if (!screenOrientation.frame())
return;
- ScreenOrientationController::from(*screenOrientation.page()).unlockOrientation();
+ ScreenOrientationController::from(*screenOrientation.frame()).unlockOrientation();
}
} // namespace WebCore
« no previous file with comments | « Source/modules/screen_orientation/ScreenOrientation.h ('k') | Source/modules/screen_orientation/ScreenOrientationController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698