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 |