diff options
| author | Andras Becsi <andras.becsi@digia.com> | 2014-03-18 13:16:26 +0100 |
|---|---|---|
| committer | Frederik Gladhorn <frederik.gladhorn@digia.com> | 2014-03-20 15:55:39 +0100 |
| commit | 3f0f86b0caed75241fa71c95a5d73bc0164348c5 (patch) | |
| tree | 92b9fb00f2e9e90b0be2262093876d4f43b6cd13 /chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp | |
| parent | e90d7c4b152c56919d963987e2503f9909a666d2 (diff) | |
Update to new stable branch 1750
This also includes an updated ninja and chromium dependencies
needed on Windows.
Change-Id: Icd597d80ed3fa4425933c9f1334c3c2e31291c42
Reviewed-by: Zoltan Arvai <zarvai@inf.u-szeged.hu>
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp')
| -rw-r--r-- | chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp b/chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp index 040f44d08d4..212c94fc804 100644 --- a/chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp +++ b/chromium/third_party/WebKit/Source/web/ContextMenuClientImpl.cpp @@ -49,36 +49,37 @@ #include "core/dom/Document.h" #include "core/dom/DocumentMarkerController.h" #include "core/editing/Editor.h" +#include "core/editing/SpellChecker.h" #include "core/history/HistoryItem.h" #include "core/html/HTMLFormElement.h" #include "core/html/HTMLInputElement.h" #include "core/html/HTMLMediaElement.h" -#include "core/html/HTMLPlugInImageElement.h" +#include "core/html/HTMLPlugInElement.h" #include "core/html/HTMLVideoElement.h" #include "core/html/MediaError.h" #include "core/loader/DocumentLoader.h" #include "core/loader/FrameLoader.h" #include "core/page/ContextMenuController.h" #include "core/page/EventHandler.h" -#include "core/page/FrameView.h" +#include "core/frame/FrameView.h" #include "core/page/Page.h" -#include "core/page/Settings.h" -#include "core/platform/ContextMenu.h" -#include "core/platform/Widget.h" -#include "core/platform/text/TextBreakIterator.h" +#include "core/frame/Settings.h" #include "core/rendering/HitTestResult.h" #include "core/rendering/RenderWidget.h" +#include "platform/ContextMenu.h" +#include "platform/Widget.h" +#include "platform/text/TextBreakIterator.h" +#include "platform/weborigin/KURL.h" #include "public/platform/WebPoint.h" #include "public/platform/WebString.h" #include "public/platform/WebURL.h" #include "public/platform/WebURLResponse.h" #include "public/platform/WebVector.h" -#include "weborigin/KURL.h" #include "wtf/text/WTFString.h" using namespace WebCore; -namespace WebKit { +namespace blink { // Figure out the URL of a page or subframe. Returns |page_type| as the type, // which indicates page or subframe, or ContextNodeType::NONE if the URL could not @@ -86,7 +87,7 @@ namespace WebKit { static WebURL urlFromFrame(Frame* frame) { if (frame) { - DocumentLoader* dl = frame->loader()->documentLoader(); + DocumentLoader* dl = frame->loader().documentLoader(); if (dl) { WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); if (ds) @@ -100,7 +101,7 @@ static WebURL urlFromFrame(Frame* frame) static bool isASingleWord(const String& text) { TextBreakIterator* it = wordBreakIterator(text, 0, text.length()); - return it && textBreakNext(it) == static_cast<int>(text.length()); + return it && it->next() == static_cast<int>(text.length()); } // Helper function to get misspelled word on which context menu @@ -121,7 +122,7 @@ static String selectMisspelledWord(Frame* selectedFrame) } // Selection is empty, so change the selection to the word under the cursor. - HitTestResult hitTestResult = selectedFrame->eventHandler()-> + HitTestResult hitTestResult = selectedFrame->eventHandler(). hitTestResultAtPoint(selectedFrame->page()->contextMenuController().hitTestResult().pointInInnerNodeFrame()); Node* innerNode = hitTestResult.innerNode(); VisiblePosition pos(innerNode->renderer()->positionForPoint( @@ -188,7 +189,9 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM Frame* selectedFrame = r.innerNodeFrame(); WebContextMenuData data; - data.mousePosition = selectedFrame->view()->contentsToWindow(r.roundedPointInInnerNodeFrame()); + IntPoint mousePoint = selectedFrame->view()->contentsToWindow(r.roundedPointInInnerNodeFrame()); + mousePoint.scale(m_webView->pageScaleFactor(), m_webView->pageScaleFactor()); + data.mousePosition = mousePoint; // Compute edit flags. data.editFlags = WebContextMenuData::CanDoNone; @@ -261,7 +264,7 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM if (plugin->plugin()->supportsPaginatedPrint()) data.mediaFlags |= WebContextMenuData::MediaCanPrint; - HTMLPlugInImageElement* pluginElement = toHTMLPlugInImageElement(r.innerNonSharedNode()); + HTMLPlugInElement* pluginElement = toHTMLPlugInElement(r.innerNonSharedNode()); data.srcURL = pluginElement->document().completeURL(pluginElement->url()); data.mediaFlags |= WebContextMenuData::MediaCanSave; @@ -287,7 +290,7 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM data.pageURL = urlFromFrame(m_webView->mainFrameImpl()->frame()); if (selectedFrame != m_webView->mainFrameImpl()->frame()) { data.frameURL = urlFromFrame(selectedFrame); - RefPtr<HistoryItem> historyItem = selectedFrame->loader()->history()->currentItem(); + RefPtr<HistoryItem> historyItem = selectedFrame->loader().currentItem(); if (historyItem) data.frameHistoryItem = WebHistoryItem(historyItem); } @@ -320,9 +323,9 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM } } else { data.isSpellCheckingEnabled = - m_webView->focusedWebCoreFrame()->editor().isContinuousSpellCheckingEnabled(); + m_webView->focusedWebCoreFrame()->spellChecker().isContinuousSpellCheckingEnabled(); // Spellchecking might be enabled for the field, but could be disabled on the node. - if (m_webView->focusedWebCoreFrame()->editor().isSpellCheckingEnabledInFocusedNode()) { + if (m_webView->focusedWebCoreFrame()->spellChecker().isSpellCheckingEnabledInFocusedNode()) { data.misspelledWord = selectMisspelledWord(selectedFrame); if (m_webView->spellCheckClient()) { int misspelledOffset, misspelledLength; @@ -345,15 +348,13 @@ void ContextMenuClientImpl::showContextMenu(const WebCore::ContextMenu* defaultM } } -#if OS(MACOSX) if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "ltr") != FalseTriState) data.writingDirectionLeftToRight |= WebContextMenuData::CheckableMenuItemChecked; if (selectedFrame->editor().selectionHasStyle(CSSPropertyDirection, "rtl") != FalseTriState) data.writingDirectionRightToLeft |= WebContextMenuData::CheckableMenuItemChecked; -#endif // OS(MACOSX) // Now retrieve the security info. - DocumentLoader* dl = selectedFrame->loader()->documentLoader(); + DocumentLoader* dl = selectedFrame->loader().documentLoader(); WebDataSource* ds = WebDataSourceImpl::fromDocumentLoader(dl); if (ds) data.securityInfo = ds->response().securityInfo(); @@ -418,4 +419,4 @@ void ContextMenuClientImpl::populateCustomMenuItems(const WebCore::ContextMenu* populateSubMenuItems(defaultMenu->items(), data->customItems); } -} // namespace WebKit +} // namespace blink |
