alloy: win: Add spelling suggestions in context menu (fixes #3055)

This commit is contained in:
Michael Bragg
2025-03-18 12:08:47 -04:00
committed by Marshall Greenblatt
parent f72afb713a
commit aa4734b714
2 changed files with 53 additions and 3 deletions

View File

@@ -13,6 +13,10 @@
#include "content/public/browser/context_menu_params.h"
#include "content/public/browser/web_contents_observer.h"
#if BUILDFLAG(IS_WIN)
#include "components/spellcheck/common/spellcheck_common.h"
#endif
namespace content {
class RenderFrameHost;
class WebContents;
@@ -39,7 +43,8 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
bool IsShowingContextMenu();
// Create the context menu.
bool CreateContextMenu(const content::ContextMenuParams& params);
bool CreateContextMenu(const content::ContextMenuParams& params,
bool query_spellcheck = true);
void CancelContextMenu();
private:
@@ -62,6 +67,12 @@ class CefMenuManager : public CefMenuModelImpl::Delegate,
// Returns true if the specified id is a custom context menu command.
bool IsCustomContextMenuCommand(int command_id);
#if BUILDFLAG(IS_WIN)
void OnGetPlatformSuggestionsComplete(
const spellcheck::PerLanguageSuggestions&
platform_per_language_suggestions);
#endif
// AlloyBrowserHostImpl pointer is guaranteed to outlive this object.
raw_ptr<AlloyBrowserHostImpl> browser_;