Chromium Code Reviews| Index: Source/web/ContextMenuClientImpl.cpp |
| diff --git a/Source/web/ContextMenuClientImpl.cpp b/Source/web/ContextMenuClientImpl.cpp |
| index 9dee300e67cfa86e45a59c825fa77a6907256aa0..676f5429280507f3fe86089cfa98aef6cbad32ce 100644 |
| --- a/Source/web/ContextMenuClientImpl.cpp |
| +++ b/Source/web/ContextMenuClientImpl.cpp |
| @@ -195,17 +195,17 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM |
| // Compute edit flags. |
| data.editFlags = WebContextMenuData::CanDoNone; |
| - if (m_webView->focusedWebCoreFrame()->editor().canUndo()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canUndo()) |
|
dcheng
2014/03/17 18:17:44
Hm... what guarantees that these are always focuse
kenrb
2014/03/18 20:01:19
The downcast macro already contains an ASSERT. I t
|
| data.editFlags |= WebContextMenuData::CanUndo; |
| - if (m_webView->focusedWebCoreFrame()->editor().canRedo()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canRedo()) |
| data.editFlags |= WebContextMenuData::CanRedo; |
| - if (m_webView->focusedWebCoreFrame()->editor().canCut()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCut()) |
| data.editFlags |= WebContextMenuData::CanCut; |
| - if (m_webView->focusedWebCoreFrame()->editor().canCopy()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canCopy()) |
| data.editFlags |= WebContextMenuData::CanCopy; |
| - if (m_webView->focusedWebCoreFrame()->editor().canPaste()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canPaste()) |
| data.editFlags |= WebContextMenuData::CanPaste; |
| - if (m_webView->focusedWebCoreFrame()->editor().canDelete()) |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->editor().canDelete()) |
| data.editFlags |= WebContextMenuData::CanDelete; |
| // We can always select all... |
| data.editFlags |= WebContextMenuData::CanSelectAll; |
| @@ -323,9 +323,9 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM |
| } |
| } else { |
| data.isSpellCheckingEnabled = |
| - m_webView->focusedWebCoreFrame()->spellChecker().isContinuousSpellCheckingEnabled(); |
| + toLocalFrame(m_webView->focusedWebCoreFrame())->spellChecker().isContinuousSpellCheckingEnabled(); |
| // Spellchecking might be enabled for the field, but could be disabled on the node. |
| - if (m_webView->focusedWebCoreFrame()->spellChecker().isSpellCheckingEnabledInFocusedNode()) { |
| + if (toLocalFrame(m_webView->focusedWebCoreFrame())->spellChecker().isSpellCheckingEnabledInFocusedNode()) { |
| data.misspelledWord = selectMisspelledWord(selectedFrame); |
| if (m_webView->spellCheckClient()) { |
| int misspelledOffset, misspelledLength; |