chore: remove deprecated inputFieldType
(#41239)
chore: remove deprecated inputFieldType
This commit is contained in:
parent
3394ee71f0
commit
3885011220
5 changed files with 11 additions and 57 deletions
|
@ -23,51 +23,6 @@
|
|||
#include "ui/events/keycodes/dom/keycode_converter.h"
|
||||
#include "ui/events/keycodes/keyboard_code_conversion.h"
|
||||
|
||||
namespace {
|
||||
|
||||
[[nodiscard]] constexpr std::string_view FormControlToInputFieldTypeString(
|
||||
const std::optional<blink::mojom::FormControlType> form_control_type) {
|
||||
if (!form_control_type)
|
||||
return "none";
|
||||
|
||||
switch (*form_control_type) {
|
||||
case blink::mojom::FormControlType::kInputPassword:
|
||||
return "password";
|
||||
|
||||
case blink::mojom::FormControlType::kInputText:
|
||||
return "plainText";
|
||||
|
||||
// other input types:
|
||||
case blink::mojom::FormControlType::kInputButton:
|
||||
case blink::mojom::FormControlType::kInputCheckbox:
|
||||
case blink::mojom::FormControlType::kInputColor:
|
||||
case blink::mojom::FormControlType::kInputDate:
|
||||
case blink::mojom::FormControlType::kInputDatetimeLocal:
|
||||
case blink::mojom::FormControlType::kInputEmail:
|
||||
case blink::mojom::FormControlType::kInputFile:
|
||||
case blink::mojom::FormControlType::kInputHidden:
|
||||
case blink::mojom::FormControlType::kInputImage:
|
||||
case blink::mojom::FormControlType::kInputMonth:
|
||||
case blink::mojom::FormControlType::kInputNumber:
|
||||
case blink::mojom::FormControlType::kInputRadio:
|
||||
case blink::mojom::FormControlType::kInputRange:
|
||||
case blink::mojom::FormControlType::kInputReset:
|
||||
case blink::mojom::FormControlType::kInputSearch:
|
||||
case blink::mojom::FormControlType::kInputSubmit:
|
||||
case blink::mojom::FormControlType::kInputTelephone:
|
||||
case blink::mojom::FormControlType::kInputTime:
|
||||
case blink::mojom::FormControlType::kInputUrl:
|
||||
case blink::mojom::FormControlType::kInputWeek:
|
||||
return "other";
|
||||
|
||||
// not an input type
|
||||
default:
|
||||
return "none";
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
namespace gin {
|
||||
|
||||
static constexpr auto MenuSourceTypes =
|
||||
|
@ -162,12 +117,6 @@ v8::Local<v8::Value> Converter<ContextMenuParamsWithRenderFrameHost>::ToV8(
|
|||
dict.Set("frameCharset", params.frame_charset);
|
||||
dict.Set("referrerPolicy", params.referrer_policy);
|
||||
dict.Set("formControlType", params.form_control_type);
|
||||
|
||||
// NB: inputFieldType is deprecated because the upstream
|
||||
// field was removed; we are emulating it now until removal
|
||||
dict.Set("inputFieldType",
|
||||
FormControlToInputFieldTypeString(params.form_control_type));
|
||||
|
||||
dict.Set("menuSourceType", params.source_type);
|
||||
|
||||
return gin::ConvertToV8(isolate, dict);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue