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,17 +191,17 @@ v8::Local<v8::Value> Converter<content::PermissionType>::ToV8(
break; break;
} }
if (val == static_cast<content::PermissionType>(PermissionType::POINTER_LOCK)) switch (static_cast<PermissionType>(val)) {
case PermissionType::POINTER_LOCK:
return StringToV8(isolate, "pointerLock"); return StringToV8(isolate, "pointerLock");
else if (val == case PermissionType::FULLSCREEN:
static_cast<content::PermissionType>(PermissionType::FULLSCREEN))
return StringToV8(isolate, "fullscreen"); return StringToV8(isolate, "fullscreen");
else if (val == case PermissionType::OPEN_EXTERNAL:
static_cast<content::PermissionType>(PermissionType::OPEN_EXTERNAL))
return StringToV8(isolate, "openExternal"); return StringToV8(isolate, "openExternal");
default:
return StringToV8(isolate, "unknown"); return StringToV8(isolate, "unknown");
} }
}
// static // static
bool Converter<content::StopFindAction>::FromV8(v8::Isolate* isolate, bool Converter<content::StopFindAction>::FromV8(v8::Isolate* isolate,