Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / content / child / assert_matching_enums.cc
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
3 // found in the LICENSE file.
4
5 // Use this file to assert that *_list.h enums that are meant to do the bridge
6 // from Blink are valid.
7
8 #include "base/macros.h"
9 #include "cc/animation/animation.h"
10 #include "content/public/common/screen_orientation_values.h"
11 #include "net/base/mime_util.h"
12 #include "third_party/WebKit/public/platform/WebCompositorAnimation.h"
13 #include "third_party/WebKit/public/platform/WebMimeRegistry.h"
14 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h"
15
16 namespace content {
17
18 #define COMPILE_ASSERT_MATCHING_ENUM(expected, actual) \
19   COMPILE_ASSERT(int(expected) == int(actual), mismatching_enums)
20
21 // ScreenOrientationValues
22 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockDefault,
23     DEFAULT);
24 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockPortraitPrimary,
25     PORTRAIT_PRIMARY);
26 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockPortraitSecondary,
27     PORTRAIT_SECONDARY);
28 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockLandscapePrimary,
29     LANDSCAPE_PRIMARY);
30 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockLandscapeSecondary,
31     LANDSCAPE_SECONDARY);
32 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockAny,
33     ANY);
34 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockLandscape,
35     LANDSCAPE);
36 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockPortrait,
37     PORTRAIT);
38 COMPILE_ASSERT_MATCHING_ENUM(blink::WebScreenOrientationLockNatural,
39     NATURAL);
40
41 // SupportsType
42 COMPILE_ASSERT_MATCHING_ENUM(blink::WebMimeRegistry::IsNotSupported,
43     net::IsNotSupported);
44 COMPILE_ASSERT_MATCHING_ENUM(blink::WebMimeRegistry::IsSupported,
45     net::IsSupported);
46 COMPILE_ASSERT_MATCHING_ENUM(blink::WebMimeRegistry::MayBeSupported,
47     net::MayBeSupported);
48
49 // TargetProperty
50 COMPILE_ASSERT_MATCHING_ENUM(
51     blink::WebCompositorAnimation::TargetPropertyTransform,
52     cc::Animation::Transform);
53 COMPILE_ASSERT_MATCHING_ENUM(
54     blink::WebCompositorAnimation::TargetPropertyOpacity,
55     cc::Animation::Opacity);
56 COMPILE_ASSERT_MATCHING_ENUM(
57     blink::WebCompositorAnimation::TargetPropertyFilter,
58     cc::Animation::Filter);
59 COMPILE_ASSERT_MATCHING_ENUM(
60     blink::WebCompositorAnimation::TargetPropertyScrollOffset,
61     cc::Animation::ScrollOffset);
62
63 } // namespace content