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

Unified Diff: Source/web/ScreenOrientationClientProxy.cpp

Issue 132113006: Add initial Blink-side support for the Screen Orientation API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Update compile-time assertion for matching enum Created 6 years, 10 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/web/ScreenOrientationClientProxy.cpp
diff --git a/Source/web/ScreenOrientationClientProxy.cpp b/Source/web/ScreenOrientationClientProxy.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..363d9fe287f7dcb62a14ba45e0c9e14adbacdaf9
--- /dev/null
+++ b/Source/web/ScreenOrientationClientProxy.cpp
@@ -0,0 +1,41 @@
+// 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.
+
+#include "config.h"
+#include "ScreenOrientationClientProxy.h"
+
+#include "WebScreenOrientationClient.h"
+#include "WebScreenOrientationController.h"
+#include "modules/screen_orientation/ScreenOrientationController.h"
+
+namespace blink {
+
+using namespace WebCore;
+
+ScreenOrientationClientProxy::ScreenOrientationClientProxy(WebScreenOrientationClient* client)
+ : m_client(client)
+{
+}
+
+void ScreenOrientationClientProxy::setController(ScreenOrientationController* controller)
+{
+ if (m_client) {
+ // Ownership of the WebScreenOrientationController is transferred to the client.
+ m_client->setController(new WebScreenOrientationController(controller));
+ }
+}
+
+void ScreenOrientationClientProxy::lockOrientation(ScreenOrientationValues orientations)
+{
+ if (m_client)
+ m_client->lockOrientation(orientations);
+}
+
+void ScreenOrientationClientProxy::unlockOrientation()
+{
+ if (m_client)
+ m_client->unlockOrientation();
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698