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

Unified Diff: Source/web/SpellCheckerClientImpl.cpp

Issue 219903002: Revert 170347 "Convert HTMLFrameOwnerElement and FocusController..." (Closed) Base URL: svn://svn.chromium.org/blink/branches/chromium/1917/
Patch Set: Created 6 years, 9 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/web/ContextMenuClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/web/SpellCheckerClientImpl.cpp
===================================================================
--- Source/web/SpellCheckerClientImpl.cpp (revision 170478)
+++ Source/web/SpellCheckerClientImpl.cpp (working copy)
@@ -56,9 +56,7 @@
{
// Spellcheck should be enabled for all editable areas (such as textareas,
// contentEditable regions, designMode docs and inputs).
- if (!m_webView->focusedWebCoreFrame()->isLocalFrame())
- return false;
- const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
+ const LocalFrame* frame = m_webView->focusedWebCoreFrame();
if (!frame)
return false;
if (frame->spellChecker().isSpellCheckingEnabledInFocusedNode())
@@ -102,13 +100,11 @@
}
} else {
m_spellCheckThisFieldStatus = SpellCheckForcedOn;
- if (m_webView->focusedWebCoreFrame()->isLocalFrame()) {
- if (LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame())) {
- VisibleSelection frameSelection = frame->selection().selection();
- // If a selection is in an editable element spell check its content.
- if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
- frame->spellChecker().didBeginEditing(rootEditableElement);
- }
+ if (LocalFrame* frame = m_webView->focusedWebCoreFrame()) {
+ VisibleSelection frameSelection = frame->selection().selection();
+ // If a selection is in an editable element spell check its content.
+ if (Element* rootEditableElement = frameSelection.rootEditableElement()) {
+ frame->spellChecker().didBeginEditing(rootEditableElement);
}
}
}
@@ -116,13 +112,13 @@
bool SpellCheckerClientImpl::isGrammarCheckingEnabled()
{
- const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
+ const LocalFrame* frame = m_webView->focusedWebCoreFrame();
return frame && frame->settings() && (frame->settings()->asynchronousSpellCheckingEnabled() || frame->settings()->unifiedTextCheckerEnabled());
}
bool SpellCheckerClientImpl::shouldEraseMarkersAfterChangeSelection(TextCheckingType type) const
{
- const Frame* frame = m_webView->focusedWebCoreFrame();
+ const LocalFrame* frame = m_webView->focusedWebCoreFrame();
return !frame || !frame->settings() || (!frame->settings()->asynchronousSpellCheckingEnabled() && !frame->settings()->unifiedTextCheckerEnabled());
}
« no previous file with comments | « Source/web/ContextMenuClientImpl.cpp ('k') | Source/web/WebFrameImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698