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

Unified Diff: Source/web/SpellCheckerClientImpl.cpp

Issue 189573002: Convert HTMLFrameOwnerElement and FocusController to use Frame. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Missed a null check 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
diff --git a/Source/web/SpellCheckerClientImpl.cpp b/Source/web/SpellCheckerClientImpl.cpp
index 224be4ec2ebb57d3c3771571734cdac93e55f4da..4425752dcb9b5987a102aca9c8473a2d61716026 100644
--- a/Source/web/SpellCheckerClientImpl.cpp
+++ b/Source/web/SpellCheckerClientImpl.cpp
@@ -56,7 +56,9 @@ bool SpellCheckerClientImpl::shouldSpellcheckByDefault()
{
// Spellcheck should be enabled for all editable areas (such as textareas,
// contentEditable regions, designMode docs and inputs).
- const LocalFrame* frame = m_webView->focusedWebCoreFrame();
+ if (!m_webView->focusedWebCoreFrame()->isLocalFrame())
+ return false;
+ const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
if (!frame)
return false;
if (frame->spellChecker().isSpellCheckingEnabledInFocusedNode())
@@ -100,11 +102,13 @@ void SpellCheckerClientImpl::toggleContinuousSpellChecking()
}
} else {
m_spellCheckThisFieldStatus = SpellCheckForcedOn;
- 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);
+ 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);
+ }
}
}
}
@@ -112,13 +116,13 @@ void SpellCheckerClientImpl::toggleContinuousSpellChecking()
bool SpellCheckerClientImpl::isGrammarCheckingEnabled()
{
- const LocalFrame* frame = m_webView->focusedWebCoreFrame();
+ const LocalFrame* frame = toLocalFrame(m_webView->focusedWebCoreFrame());
return frame && frame->settings() && (frame->settings()->asynchronousSpellCheckingEnabled() || frame->settings()->unifiedTextCheckerEnabled());
}
bool SpellCheckerClientImpl::shouldEraseMarkersAfterChangeSelection(TextCheckingType type) const
{
- const LocalFrame* frame = m_webView->focusedWebCoreFrame();
+ const Frame* 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