| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "modules/screen_orientation/ScreenOrientation.h" | 5 #include "modules/screen_orientation/ScreenOrientation.h" |
| 6 | 6 |
| 7 #include "bindings/core/v8/ScriptPromise.h" | 7 #include "bindings/core/v8/ScriptPromise.h" |
| 8 #include "bindings/core/v8/ScriptPromiseResolver.h" | 8 #include "bindings/core/v8/ScriptPromiseResolver.h" |
| 9 #include "core/dom/DOMException.h" | 9 #include "core/dom/DOMException.h" |
| 10 #include "core/dom/Document.h" | 10 #include "core/dom/Document.h" |
| 11 #include "core/dom/ExceptionCode.h" | 11 #include "core/dom/ExceptionCode.h" |
| 12 #include "core/frame/LocalFrame.h" | 12 #include "core/frame/LocalFrame.h" |
| 13 #include "modules/EventTargetModules.h" | 13 #include "modules/EventTargetModules.h" |
| 14 #include "modules/screen_orientation/LockOrientationCallback.h" | 14 #include "modules/screen_orientation/LockOrientationCallback.h" |
| 15 #include "modules/screen_orientation/ScreenOrientationController.h" | 15 #include "modules/screen_orientation/ScreenOrientationController.h" |
| 16 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" | 16 #include "public/platform/modules/screen_orientation/WebScreenOrientationType.h" |
| 17 | 17 |
| 18 // This code assumes that WebScreenOrientationType values are included in WebScr
eenOrientationLockType. | 18 // This code assumes that WebScreenOrientationType values are included in |
| 19 // WebScreenOrientationLockType. |
| 19 #define STATIC_ASSERT_ENUM(a, b) \ | 20 #define STATIC_ASSERT_ENUM(a, b) \ |
| 20 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 21 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 21 "mismatching enum: " #a) | 22 "mismatching enum: " #a) |
| 22 STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitPrimary, | 23 STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitPrimary, |
| 23 blink::WebScreenOrientationLockPortraitPrimary); | 24 blink::WebScreenOrientationLockPortraitPrimary); |
| 24 STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitSecondary, | 25 STATIC_ASSERT_ENUM(blink::WebScreenOrientationPortraitSecondary, |
| 25 blink::WebScreenOrientationLockPortraitSecondary); | 26 blink::WebScreenOrientationLockPortraitSecondary); |
| 26 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapePrimary, | 27 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapePrimary, |
| 27 blink::WebScreenOrientationLockLandscapePrimary); | 28 blink::WebScreenOrientationLockLandscapePrimary); |
| 28 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapeSecondary, | 29 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLandscapeSecondary, |
| (...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 187 | 188 |
| 188 return ScreenOrientationController::from(*frame()); | 189 return ScreenOrientationController::from(*frame()); |
| 189 } | 190 } |
| 190 | 191 |
| 191 DEFINE_TRACE(ScreenOrientation) { | 192 DEFINE_TRACE(ScreenOrientation) { |
| 192 EventTargetWithInlineData::trace(visitor); | 193 EventTargetWithInlineData::trace(visitor); |
| 193 DOMWindowProperty::trace(visitor); | 194 DOMWindowProperty::trace(visitor); |
| 194 } | 195 } |
| 195 | 196 |
| 196 } // namespace blink | 197 } // namespace blink |
| OLD | NEW |