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

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

Issue 366853008: [screen-orientation] Expose orientation info in OrientationInformation interface. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review comments 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 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)

Powered by Google App Engine
This is Rietveld 408576698