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

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

Issue 332493003: Add a WebLockOrientationError independant from WebLockOrientationCallback. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@platform_cleanup
Patch Set: 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/LockOrientationCallback.cpp
diff --git a/Source/modules/screen_orientation/LockOrientationCallback.cpp b/Source/modules/screen_orientation/LockOrientationCallback.cpp
index 6f0bcf59c1773ccdb00040d006df2b41334606cb..da1088309d82ba691d4186d34dd4642c770157bb 100644
--- a/Source/modules/screen_orientation/LockOrientationCallback.cpp
+++ b/Source/modules/screen_orientation/LockOrientationCallback.cpp
@@ -52,4 +52,27 @@ void LockOrientationCallback::onError(ErrorType error)
m_resolver->reject(DOMException::create(code, msg));
}
+void LockOrientationCallback::onError(blink::WebLockOrientationError error)
+{
+ ExceptionCode code = 0;
+ String msg = "";
+
+ switch (error) {
+ case blink::WebLockOrientationErrorNotAvailable:
+ code = NotSupportedError;
+ msg = "lockOrientation() is not available on this device.";
+ break;
+ case blink::WebLockOrientationErrorFullScreenRequired:
+ code = SecurityError;
+ msg = "The page needs to be fullscreen in order to call lockOrientation().";
+ break;
+ case blink::WebLockOrientationErrorCanceled:
+ code = AbortError;
+ msg = "A call to lockOrientation() or unlockOrientation() canceled this call.";
+ break;
+ }
+
+ m_resolver->reject(DOMException::create(code, msg));
+}
+
} // namespace WebCore
« no previous file with comments | « Source/modules/screen_orientation/LockOrientationCallback.h ('k') | public/platform/WebLockOrientationCallback.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698