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

Unified Diff: public/platform/WebLockOrientationCallback.h

Issue 283423005: Use Promises for screen.lockOrientation(). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: review commenst Created 6 years, 7 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 | « public/platform/Platform.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: public/platform/WebLockOrientationCallback.h
diff --git a/public/platform/WebLockOrientationCallback.h b/public/platform/WebLockOrientationCallback.h
new file mode 100644
index 0000000000000000000000000000000000000000..46642ab1f65dacfccebeffa36257f59b790bcba6
--- /dev/null
+++ b/public/platform/WebLockOrientationCallback.h
@@ -0,0 +1,33 @@
+// Copyright 2014 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef WebLockOrientationCallback_h
+#define WebLockOrientationCallback_h
+
+#include "public/platform/WebScreenOrientationType.h"
+
+namespace blink {
+
+// WebScreenOrientationType is an interface to be used by the embedder in order
+// to inform Blink when a screen lock operation has succeeded or failed.
+// A success notification comes with the new orientation angle and orientation
+// type and a failure notification comes with an information about the type of
+// failure.
+class WebLockOrientationCallback {
+public:
+ enum ErrorType {
+ ErrorTypeNotAvailable, // If locking isn't available on the platform.
+ ErrorTypeFullScreenRequired, // If fullscreen is required to lock.
+ ErrorTypeCanceled, // If another lock/unlock got called before that one ended.
+ };
+
+ virtual ~WebLockOrientationCallback() { }
+
+ virtual void onSuccess(unsigned angle, WebScreenOrientationType) = 0;
+ virtual void onError(ErrorType) = 0;
+};
+
+} // namespace blink
+
+#endif // WebLockOrientationCallback_h
« no previous file with comments | « public/platform/Platform.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698