Commit 36f2f525 authored by andersca@apple.com's avatar andersca@apple.com

2010-12-20 Anders Carlsson <andersca@apple.com>

        Reviewed by Sam Weinig.

        Add a TextChecker class, hook up spelling and grammar toggling
        https://bugs.webkit.org/show_bug.cgi?id=51363

        * UIProcess/API/mac/WKView.mm:
        (-[WKView validateUserInterfaceItem:]):
        (-[WKView toggleContinuousSpellChecking:]):
        (-[WKView toggleGrammarChecking:]):
        * UIProcess/TextChecker.h: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::unmarkAllMisspellings):
        (WebKit::WebPageProxy::unmarkAllBadGrammar):
        * UIProcess/WebPageProxy.h:
        * UIProcess/mac/TextCheckerMac.mm: Added.
        (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
        (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::isGrammarCheckingEnabled):
        (WebKit::TextChecker::setGrammarCheckingEnabled):
        * UIProcess/qt/TextCheckerQt.cpp: Added.
        (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
        (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::isGrammarCheckingEnabled):
        (WebKit::TextChecker::setGrammarCheckingEnabled):
        * UIProcess/win/TextCheckerWin.cpp: Added.
        (WebKit::TextChecker::isContinuousSpellCheckingAllowed):
        (WebKit::TextChecker::isContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::setContinuousSpellCheckingEnabled):
        (WebKit::TextChecker::isGrammarCheckingEnabled):
        (WebKit::TextChecker::setGrammarCheckingEnabled):
        * WebKit2.pro:
        * WebKit2.xcodeproj/project.pbxproj:
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::unmarkAllMisspellings):
        (WebKit::WebPage::unmarkAllBadGrammar):
        * WebProcess/WebPage/WebPage.h:
        * WebProcess/WebPage/WebPage.messages.in:
        * win/WebKit2.vcproj:


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@74376 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent a47efaec
2010-12-20 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
Add a TextChecker class, hook up spelling and grammar toggling
https://bugs.webkit.org/show_bug.cgi?id=51363
* UIProcess/API/mac/WKView.mm:
(-[WKView validateUserInterfaceItem:]):
(-[WKView toggleContinuousSpellChecking:]):
(-[WKView toggleGrammarChecking:]):
* UIProcess/TextChecker.h: Added.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::unmarkAllMisspellings):
(WebKit::WebPageProxy::unmarkAllBadGrammar):
* UIProcess/WebPageProxy.h:
* UIProcess/mac/TextCheckerMac.mm: Added.
(WebKit::TextChecker::isContinuousSpellCheckingAllowed):
(WebKit::TextChecker::isContinuousSpellCheckingEnabled):
(WebKit::TextChecker::setContinuousSpellCheckingEnabled):
(WebKit::TextChecker::isGrammarCheckingEnabled):
(WebKit::TextChecker::setGrammarCheckingEnabled):
* UIProcess/qt/TextCheckerQt.cpp: Added.
(WebKit::TextChecker::isContinuousSpellCheckingAllowed):
(WebKit::TextChecker::isContinuousSpellCheckingEnabled):
(WebKit::TextChecker::setContinuousSpellCheckingEnabled):
(WebKit::TextChecker::isGrammarCheckingEnabled):
(WebKit::TextChecker::setGrammarCheckingEnabled):
* UIProcess/win/TextCheckerWin.cpp: Added.
(WebKit::TextChecker::isContinuousSpellCheckingAllowed):
(WebKit::TextChecker::isContinuousSpellCheckingEnabled):
(WebKit::TextChecker::setContinuousSpellCheckingEnabled):
(WebKit::TextChecker::isGrammarCheckingEnabled):
(WebKit::TextChecker::setGrammarCheckingEnabled):
* WebKit2.pro:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::unmarkAllMisspellings):
(WebKit::WebPage::unmarkAllBadGrammar):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* win/WebKit2.vcproj:
2010-12-20 Anders Carlsson <andersca@apple.com>
Reviewed by Sam Weinig.
......@@ -38,6 +38,7 @@
#import "PDFViewController.h"
#import "PageClientImpl.h"
#import "RunLoop.h"
#import "TextChecker.h"
#import "WKTextInputWindowController.h"
#import "WebContext.h"
#import "WebEventFactory.h"
......@@ -311,11 +312,31 @@ WEBCORE_COMMAND(takeFindStringFromSelection)
- (BOOL)validateUserInterfaceItem:(id <NSValidatedUserInterfaceItem>)item
{
String commandName = commandNameForSelector([item action]);
NSMenuItem *menuItem = (NSMenuItem *)item;
if (![menuItem isKindOfClass:[NSMenuItem class]])
return NO; // FIXME: We need to be able to handle other user interface elements.
SEL action = [item action];
if (action == @selector(toggleContinuousSpellChecking:)) {
bool checkMark = false;
bool returnValue = false;
if (TextChecker::isContinuousSpellCheckingAllowed())
checkMark = TextChecker::isContinuousSpellCheckingEnabled();
returnValue = true;
[menuItem setState:checkMark ? NSOnState : NSOffState];
return returnValue;
}
if (action == @selector(toggleGrammarChecking:)) {
bool checkMark = TextChecker::isGrammarCheckingEnabled();
[menuItem setState:checkMark ? NSOnState : NSOffState];
return YES;
}
String commandName = commandNameForSelector([item action]);
if (_data->_menuItemsMap.find(commandName) == _data->_menuItemsMap.end()) {
_data->_menuItemsMap.add(commandName, menuItem);
_data->_page->validateMenuItem(commandName);
......@@ -324,6 +345,24 @@ WEBCORE_COMMAND(takeFindStringFromSelection)
return YES;
}
- (IBAction)toggleContinuousSpellChecking:(id)sender
{
bool spellCheckingEnabled = !TextChecker::isContinuousSpellCheckingEnabled();
TextChecker::setContinuousSpellCheckingEnabled(spellCheckingEnabled);
if (!spellCheckingEnabled)
_data->_page->unmarkAllMisspellings();
}
- (void)toggleGrammarChecking:(id)sender
{
bool grammarCheckingEnabled = !TextChecker::isGrammarCheckingEnabled();
TextChecker::setGrammarCheckingEnabled(grammarCheckingEnabled);
if (!grammarCheckingEnabled)
_data->_page->unmarkAllBadGrammar();
}
// Events
// Override this so that AppKit will send us arrow keys as key down events so we can
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#ifndef TextChecker_h
#define TextChecker_h
namespace WebKit {
class TextChecker {
public:
static bool isContinuousSpellCheckingAllowed();
static bool isContinuousSpellCheckingEnabled();
static void setContinuousSpellCheckingEnabled(bool);
static bool isGrammarCheckingEnabled();
static void setGrammarCheckingEnabled(bool);
};
} // namespace WebKit
#endif // TextChecker_h
......@@ -1543,6 +1543,16 @@ void WebPageProxy::didCancelForOpenPanel()
m_openPanelResultListener = 0;
}
void WebPageProxy::unmarkAllMisspellings()
{
process()->send(Messages::WebPage::UnmarkAllMisspellings(), m_pageID);
}
void WebPageProxy::unmarkAllBadGrammar()
{
process()->send(Messages::WebPage::UnmarkAllBadGrammar(), m_pageID);
}
void WebPageProxy::registerEditCommand(PassRefPtr<WebEditCommandProxy> commandProxy, UndoOrRedo undoOrRedo)
{
m_pageClient->registerEditCommand(commandProxy, undoOrRedo);
......
......@@ -294,6 +294,9 @@ public:
void findZoomableAreaForPoint(const WebCore::IntPoint&);
#endif
void unmarkAllMisspellings();
void unmarkAllBadGrammar();
private:
WebPageProxy(WebContext*, WebPageGroup*, uint64_t pageID);
......
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "TextChecker.h"
namespace WebKit {
static bool continuousSpellCheckingEnabled;
static bool grammarCheckingEnabled;
bool TextChecker::isContinuousSpellCheckingAllowed()
{
static bool allowContinuousSpellChecking = true;
static bool readAllowContinuousSpellCheckingDefault = false;
if (!readAllowContinuousSpellCheckingDefault) {
if ([[NSUserDefaults standardUserDefaults] objectForKey:@"NSAllowContinuousSpellChecking"])
allowContinuousSpellChecking = [[NSUserDefaults standardUserDefaults] boolForKey:@"NSAllowContinuousSpellChecking"];
readAllowContinuousSpellCheckingDefault = true;
}
return allowContinuousSpellChecking;
}
bool TextChecker::isContinuousSpellCheckingEnabled()
{
return continuousSpellCheckingEnabled && isContinuousSpellCheckingAllowed();
}
void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
{
continuousSpellCheckingEnabled = isContinuousSpellCheckingEnabled;
// FIXME: preflight the spell checker.
}
bool TextChecker::isGrammarCheckingEnabled()
{
return grammarCheckingEnabled;
}
void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
{
grammarCheckingEnabled = isGrammarCheckingEnabled;
[[NSSpellChecker sharedSpellChecker] updatePanels];
// We call preflightSpellChecker() when turning continuous spell checking on, but we don't need to do that here
// because grammar checking only occurs on code paths that already preflight spell checking appropriately.
}
} // namespace WebKit
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "TextChecker.h"
#include "NotImplemented.h"
namespace WebKit {
bool TextChecker::isContinuousSpellCheckingAllowed()
{
notImplemented();
return false;
}
bool TextChecker::isContinuousSpellCheckingEnabled()
{
notImplemented();
return false;
}
void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
{
notImplemented();
}
bool TextChecker::isGrammarCheckingEnabled()
{
notImplemented();
return false;
}
void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
{
notImplemented();
}
} // namespace WebKit
/*
* Copyright (C) 2010 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
* THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
* BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
* SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
* INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
* CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
* THE POSSIBILITY OF SUCH DAMAGE.
*/
#include "TextChecker.h"
#include "NotImplemented.h"
namespace WebKit {
bool TextChecker::isContinuousSpellCheckingAllowed()
{
notImplemented();
return false;
}
bool TextChecker::isContinuousSpellCheckingEnabled()
{
notImplemented();
return false;
}
void TextChecker::setContinuousSpellCheckingEnabled(bool isContinuousSpellCheckingEnabled)
{
notImplemented();
}
bool TextChecker::isGrammarCheckingEnabled()
{
notImplemented();
return false;
}
void TextChecker::setGrammarCheckingEnabled(bool isGrammarCheckingEnabled)
{
notImplemented();
}
} // namespace WebKit
......@@ -328,6 +328,7 @@ HEADERS += \
UIProcess/Plugins/PluginInfoStore.h \
UIProcess/ProcessModel.h \
UIProcess/ResponsivenessTimer.h \
UIProcess/TextChecker.h \
UIProcess/TiledDrawingAreaProxy.h \
UIProcess/VisitedLinkProvider.h \
UIProcess/WebContext.h \
......@@ -555,6 +556,7 @@ SOURCES += \
UIProcess/qt/ChunkedUpdateDrawingAreaProxyQt.cpp \
UIProcess/qt/TiledDrawingAreaProxyQt.cpp \
UIProcess/qt/TiledDrawingAreaTileQt.cpp \
UIProcess/qt/TextCheckerQt.cpp \
UIProcess/qt/WebContextMenuProxyQt.cpp \
UIProcess/qt/WebContextQt.cpp \
UIProcess/qt/WebInspectorProxyQt.cpp \
......
......@@ -155,6 +155,8 @@
1A91010B1268C8CA001842F5 /* FindIndicatorWindow.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1A9101091268C8CA001842F5 /* FindIndicatorWindow.mm */; };
1AA1CC5D100FA1A10078DEBC /* QuartzCore.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */; };
1AA1CD07100FA1BA0078DEBC /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA417C912C00CCA002BE67B /* TextChecker.h */; };
1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */; };
1AA4792312A59FD9008236C3 /* PluginProcessMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 1AA4792212A59FD9008236C3 /* PluginProcessMac.mm */; };
1AA479B012A5A436008236C3 /* Carbon.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 1AA1CD06100FA1BA0078DEBC /* Carbon.framework */; };
1AA56F2911E92BC80061B882 /* PluginController.h in Headers */ = {isa = PBXBuildFile; fileRef = 1AA56F2811E92BC80061B882 /* PluginController.h */; };
......@@ -807,6 +809,8 @@
1AA1C7DE100E846E0078DEBC /* JavaScriptCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; path = JavaScriptCore.framework; sourceTree = BUILT_PRODUCTS_DIR; };
1AA1CC5C100FA1A10078DEBC /* QuartzCore.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = QuartzCore.framework; path = /System/Library/Frameworks/QuartzCore.framework; sourceTree = "<absolute>"; };
1AA1CD06100FA1BA0078DEBC /* Carbon.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Carbon.framework; path = /System/Library/Frameworks/Carbon.framework; sourceTree = "<absolute>"; };
1AA417C912C00CCA002BE67B /* TextChecker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextChecker.h; sourceTree = "<group>"; };
1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = TextCheckerMac.mm; sourceTree = "<group>"; };
1AA4792212A59FD9008236C3 /* PluginProcessMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PluginProcessMac.mm; sourceTree = "<group>"; };
1AA56F2811E92BC80061B882 /* PluginController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PluginController.h; sourceTree = "<group>"; };
1AA5889011EE70400061B882 /* NetscapePluginStream.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = NetscapePluginStream.h; sourceTree = "<group>"; };
......@@ -1897,6 +1901,7 @@
BC597074116591D000551FCA /* ProcessModel.h */,
BC111B08112F5E3C00337BAB /* ResponsivenessTimer.cpp */,
1A30066C1110F4F70031937C /* ResponsivenessTimer.h */,
1AA417C912C00CCA002BE67B /* TextChecker.h */,
1A0F29E1120B44420053D1B9 /* VisitedLinkProvider.cpp */,
1A0F29E2120B44420053D1B9 /* VisitedLinkProvider.h */,
BC72BA1B11E64907001EB4EA /* WebBackForwardList.cpp */,
......@@ -2305,6 +2310,7 @@
children = (
BC2651F511825EF800243E12 /* ChunkedUpdateDrawingAreaProxyMac.mm */,
0F5265BB11DD37860006D33C /* LayerBackedDrawingAreaProxyMac.mm */,
1AA417ED12C00D87002BE67B /* TextCheckerMac.mm */,
1A1C648611F415B700553C19 /* WebContextMac.mm */,
51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */,
51ACBB9F127A8F2C00D203B9 /* WebContextMenuProxyMac.mm */,
......@@ -2756,6 +2762,7 @@
1A4A9AA812B7E796008FE984 /* WKTextInputWindowController.h in Headers */,
1A4A9C5612B816CF008FE984 /* NetscapePluginModule.h in Headers */,
1A4A9F3312B844E2008FE984 /* PluginQuirks.h in Headers */,
1AA417CB12C00CCA002BE67B /* TextChecker.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -3178,6 +3185,7 @@
1A4A9AA912B7E796008FE984 /* WKTextInputWindowController.mm in Sources */,
1A4A9C5512B816CF008FE984 /* NetscapePluginModule.cpp in Sources */,
1A4A9C9A12B821CD008FE984 /* NetscapePluginModuleMac.mm in Sources */,
1AA417EF12C00D87002BE67B /* TextCheckerMac.mm in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......
......@@ -1126,6 +1126,22 @@ void WebPage::didCancelForOpenPanel()
m_activeOpenPanelResultListener = 0;
}
void WebPage::unmarkAllMisspellings()
{
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (Document* document = frame->document())
document->markers()->removeMarkers(DocumentMarker::Spelling);
}
}
void WebPage::unmarkAllBadGrammar()
{
for (Frame* frame = m_page->mainFrame(); frame; frame = frame->tree()->traverseNext()) {
if (Document* document = frame->document())
document->markers()->removeMarkers(DocumentMarker::Grammar);
}
}
void WebPage::setTextForActivePopupMenu(int32_t index)
{
if (!m_activePopupMenu)
......
......@@ -343,6 +343,9 @@ private:
void didChooseFilesForOpenPanel(const Vector<String>&);
void didCancelForOpenPanel();
void unmarkAllMisspellings();
void unmarkAllBadGrammar();
#if ENABLE(CONTEXT_MENUS)
void didSelectItemFromActiveContextMenu(const WebContextMenuItemData&);
#endif
......
......@@ -97,6 +97,10 @@ messages -> WebPage {
DidChooseFilesForOpenPanel(Vector<WTF::String> fileURLs)
DidCancelForOpenPanel()
# Speling and grammer.
UnmarkAllMisspellings()
UnmarkAllBadGrammar()
SetWindowResizerSize(WebCore::IntSize intersectsView)
// FIXME: This a dummy message, to avoid breaking the build for platforms that don't require
......
......@@ -1914,6 +1914,10 @@
RelativePath="..\UIProcess\ResponsivenessTimer.h"
>
</File>
<File
RelativePath="..\UIProcess\TextChecker.h"
>
</File>
<File
RelativePath="..\UIProcess\VisitedLinkProvider.cpp"
>
......@@ -2505,6 +2509,10 @@
RelativePath="..\UIProcess\win\LayerBackedDrawingAreaProxyWin.cpp"
>
</File>
<File
RelativePath="..\UIProcess\win\TextCheckerWin.cpp"
>
</File>
<File
RelativePath="..\UIProcess\win\WebContextMenuProxyWin.cpp"
>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment