| Index: content/renderer/render_widget.cc
|
| diff --git a/content/renderer/render_widget.cc b/content/renderer/render_widget.cc
|
| index 94d484f72ed7a922a2fe850a9a5bd2611ff70e1c..6d34a517df6577df9bc10e39844eb57ba30f0895 100644
|
| --- a/content/renderer/render_widget.cc
|
| +++ b/content/renderer/render_widget.cc
|
| @@ -2322,6 +2322,13 @@ void RenderWidget::hasTouchEventHandlers(bool has_handlers) {
|
| static_assert(int(blink::WebTouchAction##a) == int(TOUCH_ACTION_##b), \
|
| "mismatching enums: " #a)
|
|
|
| +inline content::TouchAction& operator|=(content::TouchAction& a,
|
| + content::TouchAction b) {
|
| + a = static_cast<content::TouchAction>(static_cast<int>(a) |
|
| + static_cast<int>(b));
|
| + return a;
|
| +}
|
| +
|
| void RenderWidget::setTouchAction(
|
| blink::WebTouchAction web_touch_action) {
|
|
|
| @@ -2330,15 +2337,35 @@ void RenderWidget::setTouchAction(
|
| if (handling_event_type_ != WebInputEvent::TouchStart)
|
| return;
|
|
|
| - // Verify the same values are used by the types so we can cast between them.
|
| +// TODO(dtapuska): A dependant change needs to land in blink to change
|
| +// the blink::WebTouchAction enum; in the meantime don't do
|
| +// a static cast between the values. (http://crbug.com/476556)
|
| +#if 0
|
| + // Verify the same values are used by the types so we can cast between them.
|
| STATIC_ASSERT_WTI_ENUM_MATCH(Auto, AUTO);
|
| STATIC_ASSERT_WTI_ENUM_MATCH(None, NONE);
|
| + STATIC_ASSERT_WTI_ENUM_MATCH(PanLeft, PAN_LEFT);
|
| + STATIC_ASSERT_WTI_ENUM_MATCH(PanRight, PAN_RIGHT);
|
| STATIC_ASSERT_WTI_ENUM_MATCH(PanX, PAN_X);
|
| + STATIC_ASSERT_WTI_ENUM_MATCH(PanUp, PAN_UP);
|
| + STATIC_ASSERT_WTI_ENUM_MATCH(PanDown, PAN_DOWN);
|
| STATIC_ASSERT_WTI_ENUM_MATCH(PanY, PAN_Y);
|
| STATIC_ASSERT_WTI_ENUM_MATCH(PinchZoom, PINCH_ZOOM);
|
|
|
| content::TouchAction content_touch_action =
|
| static_cast<content::TouchAction>(web_touch_action);
|
| +#else
|
| + content::TouchAction content_touch_action = TOUCH_ACTION_AUTO;
|
| + if (web_touch_action & blink::WebTouchActionNone)
|
| + content_touch_action |= TOUCH_ACTION_NONE;
|
| + if (web_touch_action & blink::WebTouchActionPanX)
|
| + content_touch_action |= TOUCH_ACTION_PAN_X;
|
| + if (web_touch_action & blink::WebTouchActionPanY)
|
| + content_touch_action |= TOUCH_ACTION_PAN_Y;
|
| + if (web_touch_action & blink::WebTouchActionPinchZoom)
|
| + content_touch_action |= TOUCH_ACTION_PINCH_ZOOM;
|
| +
|
| +#endif
|
| Send(new InputHostMsg_SetTouchAction(routing_id_, content_touch_action));
|
| }
|
|
|
|
|