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