Index: Source/modules/screen_orientation/ScreenOrientation.cpp |
diff --git a/Source/modules/screen_orientation/ScreenOrientation.cpp b/Source/modules/screen_orientation/ScreenOrientation.cpp |
index 8114c51173ea3ec852d08703d41b2dfd5692afb9..ae852dd5ea0e3fa1dcda5a5436b3067b83d1f1e5 100644 |
--- a/Source/modules/screen_orientation/ScreenOrientation.cpp |
+++ b/Source/modules/screen_orientation/ScreenOrientation.cpp |
@@ -14,6 +14,7 @@ |
#include "core/frame/LocalFrame.h" |
#include "core/frame/Screen.h" |
#include "modules/screen_orientation/LockOrientationCallback.h" |
+#include "modules/screen_orientation/OrientationInformation.h" |
#include "modules/screen_orientation/ScreenOrientationController.h" |
#include "public/platform/WebScreenOrientationType.h" |
@@ -116,15 +117,13 @@ ScreenOrientation::~ScreenOrientation() |
{ |
} |
-const AtomicString& ScreenOrientation::orientation(Screen& screen) |
+OrientationInformation* ScreenOrientation::orientation(Screen& screen) |
{ |
ScreenOrientation& screenOrientation = ScreenOrientation::from(screen); |
if (!screenOrientation.frame()) { |
- // FIXME: we should try to return a better guess, like the latest known value. |
- return orientationTypeToString(blink::WebScreenOrientationPortraitPrimary); |
+ return OrientationInformation::createFake(); |
abarth-chromium
2014/07/02 18:25:10
Why not just return 0? That's what we usually do
mlamouri (slow - plz ping)
2014/07/02 19:18:12
Because we are usually not throwing and if we retu
|
} |
- ScreenOrientationController& controller = ScreenOrientationController::from(*screenOrientation.frame()); |
- return orientationTypeToString(controller.orientation()); |
+ return ScreenOrientationController::from(*screenOrientation.frame()).orientation(); |
} |
ScriptPromise ScreenOrientation::lockOrientation(ScriptState* state, Screen& screen, const AtomicString& lockString) |