Fix wrong return values in a few converters

This commit is contained in:
Cheng Zhao 2015-09-18 18:21:51 +08:00
parent ff0e15bf58
commit 7b2980434c
2 changed files with 8 additions and 8 deletions

View file

@ -847,7 +847,7 @@ void WebContents::SendInputEvent(v8::Isolate* isolate,
} }
isolate->ThrowException(v8::Exception::Error(mate::StringToV8( isolate->ThrowException(v8::Exception::Error(mate::StringToV8(
isolate, "Invalid event type"))); isolate, "Invalid event object")));
} }
void WebContents::BeginFrameSubscription( void WebContents::BeginFrameSubscription(

View file

@ -73,7 +73,7 @@ struct Converter<blink::WebInputEvent::Type> {
*out = blink::WebInputEvent::TouchEnd; *out = blink::WebInputEvent::TouchEnd;
else if (type == "touchcancel") else if (type == "touchcancel")
*out = blink::WebInputEvent::TouchCancel; *out = blink::WebInputEvent::TouchCancel;
return false; return true;
} }
}; };
@ -108,12 +108,12 @@ struct Converter<blink::WebInputEvent::Modifiers> {
*out = blink::WebInputEvent::IsLeft; *out = blink::WebInputEvent::IsLeft;
else if (modifier == "right") else if (modifier == "right")
*out = blink::WebInputEvent::IsRight; *out = blink::WebInputEvent::IsRight;
return false; return true;
} }
}; };
int GetWebInputEventType(v8::Isolate* isolate, v8::Local<v8::Value> val) { int GetWebInputEventType(v8::Isolate* isolate, v8::Local<v8::Value> val) {
int type = -1; blink::WebInputEvent::Type type = blink::WebInputEvent::Undefined;
mate::Dictionary dict; mate::Dictionary dict;
ConvertFromV8(isolate, val, &dict) && dict.Get("type", &type); ConvertFromV8(isolate, val, &dict) && dict.Get("type", &type);
return type; return type;
@ -152,7 +152,7 @@ bool Converter<blink::WebKeyboardEvent>::FromV8(
if (shifted) if (shifted)
out->modifiers |= blink::WebInputEvent::ShiftKey; out->modifiers |= blink::WebInputEvent::ShiftKey;
out->setKeyIdentifierFromWindowsKeyCode(); out->setKeyIdentifierFromWindowsKeyCode();
return false; return true;
} }
bool Converter<content::NativeWebKeyboardEvent>::FromV8( bool Converter<content::NativeWebKeyboardEvent>::FromV8(
@ -164,7 +164,7 @@ bool Converter<content::NativeWebKeyboardEvent>::FromV8(
if (!ConvertFromV8(isolate, val, static_cast<blink::WebKeyboardEvent*>(out))) if (!ConvertFromV8(isolate, val, static_cast<blink::WebKeyboardEvent*>(out)))
return false; return false;
dict.Get("skipInBrowser", &out->skip_in_browser); dict.Get("skipInBrowser", &out->skip_in_browser);
return false; return true;
} }
bool Converter<blink::WebMouseEvent>::FromV8( bool Converter<blink::WebMouseEvent>::FromV8(
@ -181,7 +181,7 @@ bool Converter<blink::WebMouseEvent>::FromV8(
dict.Get("movementX", &out->movementX); dict.Get("movementX", &out->movementX);
dict.Get("movementY", &out->movementY); dict.Get("movementY", &out->movementY);
dict.Get("clickCount", &out->clickCount); dict.Get("clickCount", &out->clickCount);
return false; return true;
} }
bool Converter<blink::WebMouseWheelEvent>::FromV8( bool Converter<blink::WebMouseWheelEvent>::FromV8(
@ -200,7 +200,7 @@ bool Converter<blink::WebMouseWheelEvent>::FromV8(
dict.Get("accelerationRatioY", &out->accelerationRatioY); dict.Get("accelerationRatioY", &out->accelerationRatioY);
dict.Get("hasPreciseScrollingDeltas", &out->hasPreciseScrollingDeltas); dict.Get("hasPreciseScrollingDeltas", &out->hasPreciseScrollingDeltas);
dict.Get("canScroll", &out->canScroll); dict.Get("canScroll", &out->canScroll);
return false; return true;
} }
bool Converter<blink::WebFloatPoint>::FromV8( bool Converter<blink::WebFloatPoint>::FromV8(