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

Unified Diff: Source/web/WebScreenOrientationController.cpp

Issue 132113006: Add initial Blink-side support for the Screen Orientation API (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Reupload 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/WebScreenOrientationController.cpp
diff --git a/Source/web/WebScreenOrientationController.cpp b/Source/web/WebScreenOrientationController.cpp
new file mode 100644
index 0000000000000000000000000000000000000000..6ffa0775db7242429e4d4c4501a5c3b814092bd7
--- /dev/null
+++ b/Source/web/WebScreenOrientationController.cpp
@@ -0,0 +1,23 @@
+// 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 "WebScreenOrientationController.h"
+
+#include "modules/screen_orientation/ScreenOrientationController.h"
+
+namespace blink {
+
+// Make sure WebScreenOrientation stays in sync with WebCore::ScreenOrientationValue.
+COMPILE_ASSERT(WebScreenOrientationPortraitPrimary == static_cast<WebScreenOrientation>(WebCore::OrientationPortraitPrimary), WebScreenOrientationPortraitPrimary_Is_Wrong_Should_Be_OrientationPortraitPrimary);
+COMPILE_ASSERT(WebScreenOrientationLandscapePrimary == static_cast<WebScreenOrientation>(WebCore::OrientationLandscapePrimary), WebScreenOrientationLandscapePrimary_Is_Wrong_Should_Be_OrientationLandscapePrimary);
+COMPILE_ASSERT(WebScreenOrientationPortraitSecondary == static_cast<WebScreenOrientation>(WebCore::OrientationPortraitSecondary), WebScreenOrientationPortraitSecondary_Is_Wrong_Should_Be_OrientationPortraitSecondary);
+COMPILE_ASSERT(WebScreenOrientationLandscapeSecondary == static_cast<WebScreenOrientation>(WebCore::OrientationLandscapeSecondary), WebScreenOrientationLandscapeSecondary_Is_Wrong_Should_Be_OrientationLandscapeSecondary);
Peter Beverloo 2014/02/13 16:33:42 This is more verbose than I hoped it'd be.. I reca
Inactive 2014/02/13 17:03:24 This is the pattern I found in other files in Blin
Inactive 2014/02/13 17:06:38 Oh, I have just found: Source/web/AssertMatchingEn
Inactive 2014/02/13 17:12:31 Done.
+
+void WebScreenOrientationController::orientationChanged(WebScreenOrientation orientation)
+{
+ m_private->orientationChanged(static_cast<WebCore::ScreenOrientationValue>(orientation));
+}
+
+} // namespace blink

Powered by Google App Engine
This is Rietveld 408576698