Add blink::WebInputEvent::IsPinchGestureEventType().

https://codereview.chromium.org/2861373004
This commit is contained in:
Aleksei Kuzmin 2017-08-08 04:06:31 +03:00 committed by Cheng Zhao
parent 650902c656
commit f03ca53af5
3 changed files with 8 additions and 4 deletions

View file

@ -1479,7 +1479,8 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
if (!view)
return;
int type = mate::GetWebInputEventType(isolate, input_event);
blink::WebInputEvent::Type type = mate::GetWebInputEventType(isolate,
input_event);
if (blink::WebInputEvent::IsMouseEventType(type)) {
blink::WebMouseEvent mouse_event;
if (mate::ConvertFromV8(isolate, input_event, &mouse_event)) {

View file

@ -137,7 +137,8 @@ struct Converter<blink::WebInputEvent::Modifiers> {
}
};
int GetWebInputEventType(v8::Isolate* isolate, v8::Local<v8::Value> val) {
blink::WebInputEvent::Type GetWebInputEventType(v8::Isolate* isolate,
v8::Local<v8::Value> val) {
blink::WebInputEvent::Type type = blink::WebInputEvent::kUndefined;
mate::Dictionary dict;
ConvertFromV8(isolate, val, &dict) && dict.Get("type", &type);

View file

@ -7,10 +7,11 @@
#include "native_mate/converter.h"
#include "third_party/WebKit/public/platform/WebCache.h"
#include "third_party/WebKit/public/platform/WebInputEvent.h"
#include "third_party/WebKit/public/web/WebContextMenuData.h"
namespace blink {
class WebInputEvent;
class WebMouseEvent;
class WebMouseWheelEvent;
class WebKeyboardEvent;
@ -27,7 +28,8 @@ struct NativeWebKeyboardEvent;
namespace mate {
int GetWebInputEventType(v8::Isolate* isolate, v8::Local<v8::Value> val);
blink::WebInputEvent::Type GetWebInputEventType(v8::Isolate* isolate,
v8::Local<v8::Value> val);
template<>
struct Converter<blink::WebInputEvent> {