Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(126)

Unified Diff: Source/WebCore/editing/SpellChecker.cpp

Issue 7005023: Merge 86132 - 2011-05-10 MORITA Hajime <morrita@google.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/WebCore/editing/SpellChecker.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/editing/SpellChecker.cpp
===================================================================
--- Source/WebCore/editing/SpellChecker.cpp (revision 86210)
+++ Source/WebCore/editing/SpellChecker.cpp (working copy)
@@ -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 @@
{
}
+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::canCheckAsynchronously(Node* node) const
{
- return isCheckable(node) && isAsynchronousEnabled() && !isBusy();
+ return client() && isCheckable(node) && isAsynchronousEnabled() && !isBusy();
}
bool SpellChecker::isBusy() const
@@ -106,7 +114,7 @@
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)
« no previous file with comments | « Source/WebCore/editing/SpellChecker.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698