refactor: simplify Converter<content::PermissionType>::ToV8 (#21053)

This commit is contained in:
Milan Burda 2019-11-12 16:18:48 +01:00 committed by Alexey Kuzmin
parent 601cc6e887
commit 739b20bd13

View file

@ -191,16 +191,16 @@ v8::Local<v8::Value> Converter<content::PermissionType>::ToV8(
break;
}
if (val == static_cast<content::PermissionType>(PermissionType::POINTER_LOCK))
return StringToV8(isolate, "pointerLock");
else if (val ==
static_cast<content::PermissionType>(PermissionType::FULLSCREEN))
return StringToV8(isolate, "fullscreen");
else if (val ==
static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL))
return StringToV8(isolate, "openExternal");
return StringToV8(isolate, "unknown");
switch (static_cast<PermissionType>(val)) {
case PermissionType::POINTER_LOCK:
return StringToV8(isolate, "pointerLock");
case PermissionType::FULLSCREEN:
return StringToV8(isolate, "fullscreen");
case PermissionType::OPEN_EXTERNAL:
return StringToV8(isolate, "openExternal");
default:
return StringToV8(isolate, "unknown");
}
}
// static