| 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 // Use this file to assert that *_list.h enums that are meant to do the bridge | 5 // Use this file to assert that *_list.h enums that are meant to do the bridge |
| 6 // from Blink are valid. | 6 // from Blink are valid. |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/common/input/touch_action.h" |
| 9 #include "content/public/common/screen_orientation_values.h" | 10 #include "content/public/common/screen_orientation_values.h" |
| 10 #include "media/base/mime_util.h" | 11 #include "media/base/mime_util.h" |
| 11 #include "third_party/WebKit/public/platform/WebMimeRegistry.h" | 12 #include "third_party/WebKit/public/platform/WebMimeRegistry.h" |
| 13 #include "third_party/WebKit/public/platform/WebTextInputMode.h" |
| 14 #include "third_party/WebKit/public/platform/WebTextInputType.h" |
| 12 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" | 15 #include "third_party/WebKit/public/platform/modules/screen_orientation/WebScree
nOrientationLockType.h" |
| 13 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h" | 16 #include "third_party/WebKit/public/web/WebFrameSerializerCacheControlPolicy.h" |
| 17 #include "third_party/WebKit/public/web/WebTouchAction.h" |
| 18 #include "ui/base/ime/text_input_mode.h" |
| 19 #include "ui/base/ime/text_input_type.h" |
| 14 | 20 |
| 15 namespace content { | 21 namespace content { |
| 16 | 22 |
| 17 #define STATIC_ASSERT_ENUM(a, b) \ | 23 #define STATIC_ASSERT_ENUM(a, b) \ |
| 18 static_assert(static_cast<int>(a) == static_cast<int>(b), \ | 24 static_assert(static_cast<int>(a) == static_cast<int>(b), \ |
| 19 "mismatching enums: " #a) | 25 "mismatching enums: " #a) |
| 20 | 26 |
| 21 // ScreenOrientationValues | 27 // ScreenOrientationValues |
| 22 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLockDefault, | 28 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLockDefault, |
| 23 SCREEN_ORIENTATION_VALUES_DEFAULT); | 29 SCREEN_ORIENTATION_VALUES_DEFAULT); |
| (...skipping 14 matching lines...) Expand all Loading... |
| 38 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLockNatural, | 44 STATIC_ASSERT_ENUM(blink::WebScreenOrientationLockNatural, |
| 39 SCREEN_ORIENTATION_VALUES_NATURAL); | 45 SCREEN_ORIENTATION_VALUES_NATURAL); |
| 40 | 46 |
| 41 // SupportsType | 47 // SupportsType |
| 42 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::IsNotSupported, | 48 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::IsNotSupported, |
| 43 media::IsNotSupported); | 49 media::IsNotSupported); |
| 44 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::IsSupported, media::IsSupported); | 50 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::IsSupported, media::IsSupported); |
| 45 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::MayBeSupported, | 51 STATIC_ASSERT_ENUM(blink::WebMimeRegistry::MayBeSupported, |
| 46 media::MayBeSupported); | 52 media::MayBeSupported); |
| 47 | 53 |
| 54 // WebTextInputMode |
| 55 STATIC_ASSERT_ENUM(blink::kWebTextInputModeDefault, |
| 56 ui::TEXT_INPUT_MODE_DEFAULT); |
| 57 STATIC_ASSERT_ENUM(blink::kWebTextInputModeVerbatim, |
| 58 ui::TEXT_INPUT_MODE_VERBATIM); |
| 59 STATIC_ASSERT_ENUM(blink::kWebTextInputModeLatin, ui::TEXT_INPUT_MODE_LATIN); |
| 60 STATIC_ASSERT_ENUM(blink::kWebTextInputModeLatinName, |
| 61 ui::TEXT_INPUT_MODE_LATIN_NAME); |
| 62 STATIC_ASSERT_ENUM(blink::kWebTextInputModeLatinProse, |
| 63 ui::TEXT_INPUT_MODE_LATIN_PROSE); |
| 64 STATIC_ASSERT_ENUM(blink::kWebTextInputModeFullWidthLatin, |
| 65 ui::TEXT_INPUT_MODE_FULL_WIDTH_LATIN); |
| 66 STATIC_ASSERT_ENUM(blink::kWebTextInputModeKana, ui::TEXT_INPUT_MODE_KANA); |
| 67 STATIC_ASSERT_ENUM(blink::kWebTextInputModeKanaName, |
| 68 ui::TEXT_INPUT_MODE_KANA_NAME); |
| 69 STATIC_ASSERT_ENUM(blink::kWebTextInputModeKataKana, |
| 70 ui::TEXT_INPUT_MODE_KATAKANA); |
| 71 STATIC_ASSERT_ENUM(blink::kWebTextInputModeTel, ui::TEXT_INPUT_MODE_TEL); |
| 72 STATIC_ASSERT_ENUM(blink::kWebTextInputModeEmail, ui::TEXT_INPUT_MODE_EMAIL); |
| 73 STATIC_ASSERT_ENUM(blink::kWebTextInputModeUrl, ui::TEXT_INPUT_MODE_URL); |
| 74 |
| 75 // WebTextInputType |
| 76 STATIC_ASSERT_ENUM(blink::WebTextInputTypeNone, ui::TEXT_INPUT_TYPE_NONE); |
| 77 STATIC_ASSERT_ENUM(blink::WebTextInputTypeText, ui::TEXT_INPUT_TYPE_TEXT); |
| 78 STATIC_ASSERT_ENUM(blink::WebTextInputTypePassword, |
| 79 ui::TEXT_INPUT_TYPE_PASSWORD); |
| 80 STATIC_ASSERT_ENUM(blink::WebTextInputTypeSearch, ui::TEXT_INPUT_TYPE_SEARCH); |
| 81 STATIC_ASSERT_ENUM(blink::WebTextInputTypeEmail, ui::TEXT_INPUT_TYPE_EMAIL); |
| 82 STATIC_ASSERT_ENUM(blink::WebTextInputTypeNumber, ui::TEXT_INPUT_TYPE_NUMBER); |
| 83 STATIC_ASSERT_ENUM(blink::WebTextInputTypeTelephone, |
| 84 ui::TEXT_INPUT_TYPE_TELEPHONE); |
| 85 STATIC_ASSERT_ENUM(blink::WebTextInputTypeURL, ui::TEXT_INPUT_TYPE_URL); |
| 86 STATIC_ASSERT_ENUM(blink::WebTextInputTypeDate, ui::TEXT_INPUT_TYPE_DATE); |
| 87 STATIC_ASSERT_ENUM(blink::WebTextInputTypeDateTime, |
| 88 ui::TEXT_INPUT_TYPE_DATE_TIME); |
| 89 STATIC_ASSERT_ENUM(blink::WebTextInputTypeDateTimeLocal, |
| 90 ui::TEXT_INPUT_TYPE_DATE_TIME_LOCAL); |
| 91 STATIC_ASSERT_ENUM(blink::WebTextInputTypeMonth, ui::TEXT_INPUT_TYPE_MONTH); |
| 92 STATIC_ASSERT_ENUM(blink::WebTextInputTypeTime, ui::TEXT_INPUT_TYPE_TIME); |
| 93 STATIC_ASSERT_ENUM(blink::WebTextInputTypeWeek, ui::TEXT_INPUT_TYPE_WEEK); |
| 94 STATIC_ASSERT_ENUM(blink::WebTextInputTypeTextArea, |
| 95 ui::TEXT_INPUT_TYPE_TEXT_AREA); |
| 96 STATIC_ASSERT_ENUM(blink::WebTextInputTypeContentEditable, |
| 97 ui::TEXT_INPUT_TYPE_CONTENT_EDITABLE); |
| 98 STATIC_ASSERT_ENUM(blink::WebTextInputTypeDateTimeField, |
| 99 ui::TEXT_INPUT_TYPE_DATE_TIME_FIELD); |
| 100 |
| 101 // Check blink::WebTouchAction and content::TouchAction is kept in sync. |
| 102 STATIC_ASSERT_ENUM(blink::WebTouchActionNone, TOUCH_ACTION_NONE); |
| 103 STATIC_ASSERT_ENUM(blink::WebTouchActionPanLeft, TOUCH_ACTION_PAN_LEFT); |
| 104 STATIC_ASSERT_ENUM(blink::WebTouchActionPanRight, TOUCH_ACTION_PAN_RIGHT); |
| 105 STATIC_ASSERT_ENUM(blink::WebTouchActionPanX, TOUCH_ACTION_PAN_X); |
| 106 STATIC_ASSERT_ENUM(blink::WebTouchActionPanUp, TOUCH_ACTION_PAN_UP); |
| 107 STATIC_ASSERT_ENUM(blink::WebTouchActionPanDown, TOUCH_ACTION_PAN_DOWN); |
| 108 STATIC_ASSERT_ENUM(blink::WebTouchActionPanY, TOUCH_ACTION_PAN_Y); |
| 109 STATIC_ASSERT_ENUM(blink::WebTouchActionPan, TOUCH_ACTION_PAN); |
| 110 STATIC_ASSERT_ENUM(blink::WebTouchActionPinchZoom, TOUCH_ACTION_PINCH_ZOOM); |
| 111 STATIC_ASSERT_ENUM(blink::WebTouchActionManipulation, |
| 112 TOUCH_ACTION_MANIPULATION); |
| 113 STATIC_ASSERT_ENUM(blink::WebTouchActionDoubleTapZoom, |
| 114 TOUCH_ACTION_DOUBLE_TAP_ZOOM); |
| 115 STATIC_ASSERT_ENUM(blink::WebTouchActionAuto, TOUCH_ACTION_AUTO); |
| 116 |
| 48 } // namespace content | 117 } // namespace content |
| OLD | NEW |