Commit f4c8e2ab authored by dtapuska's avatar dtapuska Committed by Commit bot

Implement direction-specific touch-action values.

Now that change https://codereview.chromium.org/1137483003/ has landed
fix up change (https://codereview.chromium.org/1131093002/) by removing
the #if 0 and static casts.

This change doesn't provide an implementation of touch-action
because it has previously landed. But it activates
the code paths because now pan-left/pan-right/pan-up/pan-down
are passed transformed correctly between the blink and content
APIs.

BUG=476556
TEST=content_unittests

Review URL: https://codereview.chromium.org/1137153003

Cr-Commit-Position: refs/heads/master@{#330525}
parent 53c10787
...@@ -2342,10 +2342,6 @@ void RenderWidget::setTouchAction( ...@@ -2342,10 +2342,6 @@ void RenderWidget::setTouchAction(
if (handling_event_type_ != WebInputEvent::TouchStart) if (handling_event_type_ != WebInputEvent::TouchStart)
return; return;
// 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. // 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(Auto, AUTO);
STATIC_ASSERT_WTI_ENUM_MATCH(None, NONE); STATIC_ASSERT_WTI_ENUM_MATCH(None, NONE);
...@@ -2359,18 +2355,6 @@ void RenderWidget::setTouchAction( ...@@ -2359,18 +2355,6 @@ void RenderWidget::setTouchAction(
content::TouchAction content_touch_action = content::TouchAction content_touch_action =
static_cast<content::TouchAction>(web_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)); Send(new InputHostMsg_SetTouchAction(routing_id_, content_touch_action));
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment