WebKit2: Show the substitutions panel on Mac and make sure the menu items titles are
updated correctly.
https://bugs.webkit.org/show_bug.cgi?id=58179
Reviewed by Anders Carlsson.
* UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
The title of the context menu item should be opposite of whether or not the spelling panel
is visible.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::contextMenuItemSelected):
If the "Show/Hide" Substitutions item is selected, call toggleSubstitutionsPanelIsShowing.
(WebKit::WebPageProxy::substitutionsPanelIsShowing):
Ask the TextChecker.
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/TextChecker.h:
* UIProcess/mac/TextCheckerMac.mm:
(WebKit::TextChecker::substitutionsPanelIsShowing):
As the shared NSSpellChecker if the substitutionsPanel is visible.
(WebKit::TextChecker::toggleSubstitutionsPanelIsShowing):
Order the substitutionsPanel out or front (copied from WKView.mm).
* WebProcess/WebCoreSupport/mac/WebEditorClientMac.mm:
(WebKit::WebEditorClient::substitutionsPanelIsShowing):
Send a sync message to the UI process to find out.
It needs to be sync because the editor code relies on the value returned.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@83369 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKit2/UIProcess/TextChecker.h b/Source/WebKit2/UIProcess/TextChecker.h
index 391fa44..12af936 100644
--- a/Source/WebKit2/UIProcess/TextChecker.h
+++ b/Source/WebKit2/UIProcess/TextChecker.h
@@ -50,6 +50,9 @@
static bool isSmartInsertDeleteEnabled();
static void setSmartInsertDeleteEnabled(bool);
+
+ static bool substitutionsPanelIsShowing();
+ static void toggleSubstitutionsPanelIsShowing();
#elif PLATFORM(WIN)
static void continuousSpellCheckingEnabledStateChanged(bool);
static void grammarCheckingEnabledStateChanged(bool);