diff --git a/atom/common/native_mate_converters/gfx_converter.cc b/atom/common/native_mate_converters/gfx_converter.cc index 3d74bdb47840..57e7bd88eab4 100644 --- a/atom/common/native_mate_converters/gfx_converter.cc +++ b/atom/common/native_mate_converters/gfx_converter.cc @@ -78,6 +78,21 @@ bool Converter::FromV8(v8::Isolate* isolate, return true; } +template<> +struct Converter { + static v8::Handle ToV8(v8::Isolate* isolate, + const gfx::Display::TouchSupport& val) { + switch (val) { + case gfx::Display::TOUCH_SUPPORT_UNKNOWN: + return StringToV8(isolate, "unknown"); + case gfx::Display::TOUCH_SUPPORT_AVAILABLE: + return StringToV8(isolate, "available"); + case gfx::Display::TOUCH_SUPPORT_UNAVAILABLE: + return StringToV8(isolate, "unavailable"); + } + } +}; + v8::Handle Converter::ToV8(v8::Isolate* isolate, const gfx::Display& val) { mate::Dictionary dict(isolate, v8::Object::New(isolate)); @@ -87,6 +102,8 @@ v8::Handle Converter::ToV8(v8::Isolate* isolate, dict.Set("size", val.size()); dict.Set("workAreaSize", val.work_area_size()); dict.Set("scaleFactor", val.device_scale_factor()); + dict.Set("rotation", val.RotationAsDegree()); + dict.Set("touchSupport", val.touch_support()); return dict.GetHandle(); }