Title: [150064] trunk/Source/WebKit2
Revision
150064
Author
a...@apple.com
Date
2013-05-14 04:37:46 -0700 (Tue, 14 May 2013)

Log Message

Remove unused "type" field from DictionaryPopupInfo
https://bugs.webkit.org/show_bug.cgi?id=116011

Reviewed by Darin Adler.

It is unused, and furthermore, PDFPlugin sets it incorrectly anyway.

* Shared/DictionaryPopupInfo.cpp:
(WebKit::DictionaryPopupInfo::encode):
(WebKit::DictionaryPopupInfo::decode):
* Shared/DictionaryPopupInfo.h:
* WebProcess/Plugins/PDF/PDFPlugin.mm:
(WebKit::PDFPlugin::showDefinitionForAttributedString):
* WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
(WebKit::WebContextMenuClient::lookUpInDictionary):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::performDictionaryLookupAtLocation):
(WebKit::WebPage::performDictionaryLookupForSelection):
(WebKit::WebPage::performDictionaryLookupForRange):

Modified Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (150063 => 150064)


--- trunk/Source/WebKit2/ChangeLog	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/ChangeLog	2013-05-14 11:37:46 UTC (rev 150064)
@@ -1,3 +1,26 @@
+2013-05-14  Alexey Proskuryakov  <a...@apple.com>
+
+        Remove unused "type" field from DictionaryPopupInfo
+        https://bugs.webkit.org/show_bug.cgi?id=116011
+
+        Reviewed by Darin Adler.
+
+        It is unused, and furthermore, PDFPlugin sets it incorrectly anyway.
+
+        * Shared/DictionaryPopupInfo.cpp:
+        (WebKit::DictionaryPopupInfo::encode):
+        (WebKit::DictionaryPopupInfo::decode):
+        * Shared/DictionaryPopupInfo.h:
+        * WebProcess/Plugins/PDF/PDFPlugin.mm:
+        (WebKit::PDFPlugin::showDefinitionForAttributedString):
+        * WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm:
+        (WebKit::WebContextMenuClient::lookUpInDictionary):
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::performDictionaryLookupAtLocation):
+        (WebKit::WebPage::performDictionaryLookupForSelection):
+        (WebKit::WebPage::performDictionaryLookupForRange):
+
 2013-05-14  Michael BrĂ¼ning  <michael.brun...@digia.com>
 
         [WK2] Make WebPageProxy use deviceScaleFactor() in creationParameters().

Modified: trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp (150063 => 150064)


--- trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/Shared/DictionaryPopupInfo.cpp	2013-05-14 11:37:46 UTC (rev 150064)
@@ -37,7 +37,6 @@
 void DictionaryPopupInfo::encode(CoreIPC::ArgumentEncoder& encoder) const
 {
     encoder << origin;
-    encoder.encodeEnum(type);
 
 #if PLATFORM(MAC)
     bool hadOptions = options;
@@ -51,8 +50,6 @@
 {
     if (!decoder.decode(result.origin))
         return false;
-    if (!decoder.decodeEnum(result.type))
-        return false;
 #if PLATFORM(MAC)
     bool hadOptions;
     if (!decoder.decode(hadOptions))

Modified: trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h (150063 => 150064)


--- trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/Shared/DictionaryPopupInfo.h	2013-05-14 11:37:46 UTC (rev 150064)
@@ -43,13 +43,7 @@
     void encode(CoreIPC::ArgumentEncoder&) const;
     static bool decode(CoreIPC::ArgumentDecoder&, DictionaryPopupInfo&);
 
-    enum Type {
-        ContextMenu,
-        HotKey
-    };
-
     WebCore::FloatPoint origin;
-    Type type;
 #if PLATFORM(MAC)
     RetainPtr<CFDictionaryRef> options;
 #endif

Modified: trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm (150063 => 150064)


--- trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/WebProcess/Plugins/PDF/PDFPlugin.mm	2013-05-14 11:37:46 UTC (rev 150064)
@@ -920,7 +920,6 @@
 void PDFPlugin::showDefinitionForAttributedString(NSAttributedString *string, CGPoint point)
 {
     DictionaryPopupInfo dictionaryPopupInfo;
-    dictionaryPopupInfo.type = DictionaryPopupInfo::ContextMenu;
     dictionaryPopupInfo.origin = convertFromPDFViewToRootView(IntPoint(point));
 
     AttributedString attributedString;

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm (150063 => 150064)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/mac/WebContextMenuClientMac.mm	2013-05-14 11:37:46 UTC (rev 150064)
@@ -43,7 +43,7 @@
 
 void WebContextMenuClient::lookUpInDictionary(Frame* frame)
 {
-    m_page->performDictionaryLookupForSelection(DictionaryPopupInfo::ContextMenu, frame, frame->selection()->selection());
+    m_page->performDictionaryLookupForSelection(frame, frame->selection()->selection());
 }
 
 bool WebContextMenuClient::isSpeaking()

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (150063 => 150064)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2013-05-14 11:37:46 UTC (rev 150064)
@@ -514,7 +514,7 @@
     void dummy(bool&);
 
 #if PLATFORM(MAC)
-    void performDictionaryLookupForSelection(DictionaryPopupInfo::Type, WebCore::Frame*, const WebCore::VisibleSelection&);
+    void performDictionaryLookupForSelection(WebCore::Frame*, const WebCore::VisibleSelection&);
 
     bool isSpeaking();
     void speak(const String&);
@@ -760,7 +760,7 @@
 
 #if PLATFORM(MAC)
     void performDictionaryLookupAtLocation(const WebCore::FloatPoint&);
-    void performDictionaryLookupForRange(DictionaryPopupInfo::Type, WebCore::Frame*, WebCore::Range*, NSDictionary *options);
+    void performDictionaryLookupForRange(WebCore::Frame*, WebCore::Range*, NSDictionary *options);
 
     void setWindowIsVisible(bool windowIsVisible);
     void windowAndViewFramesChanged(const WebCore::FloatRect& windowFrameInScreenCoordinates, const WebCore::FloatRect& windowFrameInUnflippedScreenCoordinates, const WebCore::FloatRect& viewFrameInWindowCoordinates, const WebCore::FloatPoint& accessibilityViewCoordinates);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (150063 => 150064)


--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2013-05-14 11:32:01 UTC (rev 150063)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm	2013-05-14 11:37:46 UTC (rev 150064)
@@ -501,7 +501,7 @@
     VisiblePosition position = frame->visiblePositionForPoint(translatedPoint);
     VisibleSelection selection = m_page->focusController()->focusedOrMainFrame()->selection()->selection();
     if (shouldUseSelection(position, selection)) {
-        performDictionaryLookupForSelection(DictionaryPopupInfo::HotKey, frame, selection);
+        performDictionaryLookupForSelection(frame, selection);
         return;
     }
 
@@ -522,10 +522,10 @@
     if (!finalRange)
         return;
 
-    performDictionaryLookupForRange(DictionaryPopupInfo::HotKey, frame, finalRange.get(), options);
+    performDictionaryLookupForRange(frame, finalRange.get(), options);
 }
 
-void WebPage::performDictionaryLookupForSelection(DictionaryPopupInfo::Type type, Frame* frame, const VisibleSelection& selection)
+void WebPage::performDictionaryLookupForSelection(Frame* frame, const VisibleSelection& selection)
 {
     RefPtr<Range> selectedRange = selection.toNormalizedRange();
     if (!selectedRange)
@@ -549,10 +549,10 @@
     // Since we already have the range we want, we just need to grab the returned options.
     WKExtractWordDefinitionTokenRangeFromContextualString(fullPlainTextString, rangeToPass, &options);
 
-    performDictionaryLookupForRange(type, frame, selectedRange.get(), options);
+    performDictionaryLookupForRange(frame, selectedRange.get(), options);
 }
 
-void WebPage::performDictionaryLookupForRange(DictionaryPopupInfo::Type type, Frame* frame, Range* range, NSDictionary *options)
+void WebPage::performDictionaryLookupForRange(Frame* frame, Range* range, NSDictionary *options)
 {
     if (range->text().stripWhiteSpace().isEmpty())
         return;
@@ -568,7 +568,6 @@
     IntRect rangeRect = frame->view()->contentsToWindow(quads[0].enclosingBoundingBox());
     
     DictionaryPopupInfo dictionaryPopupInfo;
-    dictionaryPopupInfo.type = type;
     dictionaryPopupInfo.origin = FloatPoint(rangeRect.x(), rangeRect.y() + (style->fontMetrics().ascent() * pageScaleFactor()));
     dictionaryPopupInfo.options = (CFDictionaryRef)options;
 
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to