mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
fix: re-enable synchronous spellcheck on Windows (#45712)
* fix: re-enable synchronous spellcheck on Windows * revert: fix: empty suggestions with windows platform checker --------- Co-authored-by: Samuel Maddock <smaddock@slack-corp.com>
This commit is contained in:
@@ -88,7 +88,8 @@ v8::Local<v8::Value> Converter<blink::mojom::MenuItem::Type>::ToV8(
|
||||
v8::Local<v8::Value> Converter<ContextMenuParamsWithRenderFrameHost>::ToV8(
|
||||
v8::Isolate* isolate,
|
||||
const ContextMenuParamsWithRenderFrameHost& val) {
|
||||
auto [params, render_frame_host, optional_suggestions] = val;
|
||||
const auto& params = val.first;
|
||||
content::RenderFrameHost* render_frame_host = val.second;
|
||||
auto dict = gin_helper::Dictionary::CreateEmpty(isolate);
|
||||
dict.SetGetter("frame", render_frame_host, v8::DontEnum);
|
||||
dict.Set("x", params.x);
|
||||
@@ -113,11 +114,7 @@ v8::Local<v8::Value> Converter<ContextMenuParamsWithRenderFrameHost>::ToV8(
|
||||
dict.Set("misspelledWord", params.misspelled_word);
|
||||
dict.Set("selectionRect", params.selection_rect);
|
||||
#if BUILDFLAG(ENABLE_BUILTIN_SPELLCHECKER)
|
||||
if (optional_suggestions) {
|
||||
dict.Set("dictionarySuggestions", optional_suggestions.value());
|
||||
} else {
|
||||
dict.Set("dictionarySuggestions", params.dictionary_suggestions);
|
||||
}
|
||||
dict.Set("dictionarySuggestions", params.dictionary_suggestions);
|
||||
dict.Set("spellcheckEnabled", params.spellcheck_enabled);
|
||||
#else
|
||||
dict.Set("spellcheckEnabled", false);
|
||||
|
||||
@@ -26,9 +26,7 @@ struct NativeWebKeyboardEvent;
|
||||
}
|
||||
|
||||
using ContextMenuParamsWithRenderFrameHost =
|
||||
std::tuple<content::ContextMenuParams,
|
||||
content::RenderFrameHost*,
|
||||
std::optional<std::vector<std::u16string>>>;
|
||||
std::pair<content::ContextMenuParams, content::RenderFrameHost*>;
|
||||
|
||||
namespace gin {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user