diff options
author | Steve Block <steveblock@google.com> | 2011-06-10 16:52:27 +0100 |
---|---|---|
committer | Steve Block <steveblock@google.com> | 2011-06-14 01:14:02 +0100 |
commit | 54cdeeebc7adcbcd900e8b6a141a8cae27d9a631 (patch) | |
tree | 845b0d338b204a48560eca3b51b34cf92ed96840 /Source/WebCore/editing/SpellChecker.cpp | |
parent | d2c5226a647dc21d0c15267e09a3d19cf3e0d593 (diff) | |
download | external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.zip external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.gz external_webkit-54cdeeebc7adcbcd900e8b6a141a8cae27d9a631.tar.bz2 |
Merge WebKit at branches/chromium/742 r88085: Initial merge by git.
Change-Id: I0501b484b9528e31b0026e5ad64416dd6541cdde
Diffstat (limited to 'Source/WebCore/editing/SpellChecker.cpp')
-rw-r--r-- | Source/WebCore/editing/SpellChecker.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/Source/WebCore/editing/SpellChecker.cpp b/Source/WebCore/editing/SpellChecker.cpp index fedcc07..c6ca926 100644 --- a/Source/WebCore/editing/SpellChecker.cpp +++ b/Source/WebCore/editing/SpellChecker.cpp @@ -33,6 +33,7 @@ #include "HTMLInputElement.h" #include "HTMLTextAreaElement.h" #include "Node.h" +#include "Page.h" #include "PositionIterator.h" #include "Range.h" #include "RenderObject.h" @@ -43,9 +44,8 @@ namespace WebCore { -SpellChecker::SpellChecker(Frame* frame, TextCheckerClient* client) +SpellChecker::SpellChecker(Frame* frame) : m_frame(frame) - , m_client(client) , m_requestSequence(0) { } @@ -54,6 +54,14 @@ SpellChecker::~SpellChecker() { } +TextCheckerClient* SpellChecker::client() const +{ + Page* page = m_frame->page(); + if (!page) + return 0; + return page->editorClient()->textChecker(); +} + bool SpellChecker::initRequest(Node* node) { ASSERT(canCheckAsynchronously(node)); @@ -82,7 +90,7 @@ bool SpellChecker::isAsynchronousEnabled() const bool SpellChecker::canCheckAsynchronously(Node* node) const { - return isCheckable(node) && isAsynchronousEnabled() && !isBusy(); + return client() && isCheckable(node) && isAsynchronousEnabled() && !isBusy(); } bool SpellChecker::isBusy() const @@ -106,7 +114,7 @@ void SpellChecker::requestCheckingFor(TextCheckingTypeMask mask, Node* node) if (!initRequest(node)) return; - m_client->requestCheckingOfString(this, m_requestSequence, mask, m_requestText); + client()->requestCheckingOfString(this, m_requestSequence, mask, m_requestText); } static bool forwardIterator(PositionIterator& iterator, int distance) |