webContents: fix value of contextMenu hasImageContents property

This commit is contained in:
deepak1556 2016-08-12 00:55:20 +05:30
parent 58b391cb77
commit ee298ea0e3

View file

@ -104,7 +104,10 @@ v8::Local<v8::Value> Converter<ContextMenuParamsWithWebContents>::ToV8(
dict.Set("srcURL", params.src_url);
dict.Set("mediaType", params.media_type);
dict.Set("mediaFlags", MediaFlagsToV8(isolate, params.media_flags));
dict.Set("hasImageContents", params.has_image_contents);
bool has_image_contents =
(params.media_type == blink::WebContextMenuData::MediaTypeImage) &&
params.has_image_contents;
dict.Set("hasImageContents", has_image_contents);
dict.Set("isEditable", params.is_editable);
dict.Set("editFlags", EditFlagsToV8(isolate, params.edit_flags));
dict.Set("selectionText", params.selection_text);