Commit f2ebdd3f authored by xiaochengh's avatar xiaochengh Committed by Commit bot

Add IdleSpellCheckCallback to LocalFrame

This patch makes each LocalFrame own an IdleSpellCheckCallback. Future
patches will make this callback handle spell checking in the frame when
IdleTimeSpellChecking is enabled.

BUG=517298

Review-Url: https://codereview.chromium.org/2581063002
Cr-Commit-Position: refs/heads/master@{#439042}
parent e47aea37
......@@ -14,7 +14,6 @@ namespace blink {
// Main class for the implementation of idle time spell checker.
class IdleSpellCheckCallback final : public IdleRequestCallback {
public:
// TODO(xiaochengh): Make each LocalFrame own an IdleSpellCheckCallback.
static IdleSpellCheckCallback* create(LocalFrame&);
~IdleSpellCheckCallback() override;
......
......@@ -40,6 +40,7 @@
#include "core/editing/FrameSelection.h"
#include "core/editing/InputMethodController.h"
#include "core/editing/serializers/Serialization.h"
#include "core/editing/spellcheck/IdleSpellCheckCallback.h"
#include "core/editing/spellcheck/SpellChecker.h"
#include "core/events/Event.h"
#include "core/fetch/ResourceFetcher.h"
......@@ -345,6 +346,7 @@ DEFINE_TRACE(LocalFrame) {
visitor->trace(m_eventHandler);
visitor->trace(m_console);
visitor->trace(m_inputMethodController);
visitor->trace(m_idleSpellCheckCallback);
Frame::trace(visitor);
Supplementable<LocalFrame>::trace(visitor);
}
......@@ -885,6 +887,7 @@ inline LocalFrame::LocalFrame(FrameLoaderClient* client,
m_eventHandler(new EventHandler(*this)),
m_console(FrameConsole::create(*this)),
m_inputMethodController(InputMethodController::create(*this)),
m_idleSpellCheckCallback(IdleSpellCheckCallback::create(*this)),
m_navigationDisableCount(0),
m_pageZoomFactor(parentPageZoomFactor(this)),
m_textZoomFactor(parentTextZoomFactor(this)),
......
......@@ -58,6 +58,7 @@ class FloatSize;
class FrameConsole;
class FrameSelection;
class FrameView;
class IdleSpellCheckCallback;
class InputMethodController;
class InstrumentingAgents;
class InterfaceProvider;
......@@ -144,6 +145,7 @@ class CORE_EXPORT LocalFrame final : public Frame,
ScriptController& script() const;
SpellChecker& spellChecker() const;
FrameConsole& console() const;
IdleSpellCheckCallback& idleSpellCheckCallback() const;
// This method is used to get the highest level LocalFrame in this
// frame's in-process subtree.
......@@ -258,6 +260,7 @@ class CORE_EXPORT LocalFrame final : public Frame,
const Member<EventHandler> m_eventHandler;
const Member<FrameConsole> m_console;
const Member<InputMethodController> m_inputMethodController;
const Member<IdleSpellCheckCallback> m_idleSpellCheckCallback;
int m_navigationDisableCount;
......@@ -327,6 +330,11 @@ inline EventHandler& LocalFrame::eventHandler() const {
return *m_eventHandler;
}
inline IdleSpellCheckCallback& LocalFrame::idleSpellCheckCallback() const {
DCHECK(m_idleSpellCheckCallback);
return *m_idleSpellCheckCallback;
}
DEFINE_TYPE_CASTS(LocalFrame,
Frame,
localFrame,
......
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