WebContextMenuClient::fixMenuReceivedFromOldSafari is no longer needed on Windows
authorbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Dec 2010 22:36:04 +0000 (22:36 +0000)
committerbweinstein@apple.com <bweinstein@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 Dec 2010 22:36:04 +0000 (22:36 +0000)
https://bugs.webkit.org/show_bug.cgi?id=50486

Reviewed by Brady Eidson.

Remove the static fixMenuReceivedFromOldSafari and isPreInspectElementTagSafari methods
from WebContextMenuClient. There were there for when WebKit had the Inspect Element context menu
item, but Safari didn't support it. We don't support that old Safari, so that code can go.

* WebCoreSupport/WebContextMenuClient.cpp:
(WebContextMenuClient::getCustomMenuFromDefaultItems):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@73305 268f45cc-cd09-0410-ab3c-d52691b4dbfc

WebKit/win/ChangeLog
WebKit/win/WebCoreSupport/WebContextMenuClient.cpp

index 69f6af1..b45062a 100644 (file)
@@ -1,3 +1,17 @@
+2010-12-03  Brian Weinstein  <bweinstein@apple.com>
+
+        Reviewed by Brady Eidson.
+
+        WebContextMenuClient::fixMenuReceivedFromOldSafari is no longer needed on Windows
+        https://bugs.webkit.org/show_bug.cgi?id=50486
+        
+        Remove the static fixMenuReceivedFromOldSafari and isPreInspectElementTagSafari methods 
+        from WebContextMenuClient. There were there for when WebKit had the Inspect Element context menu
+        item, but Safari didn't support it. We don't support that old Safari, so that code can go.
+
+        * WebCoreSupport/WebContextMenuClient.cpp:
+        (WebContextMenuClient::getCustomMenuFromDefaultItems):
+
 2010-12-02  John Knottenbelt  <jknotten@chromium.org>
 
         Reviewed by Steve Block.
index 24178f2..ede44e2 100644 (file)
@@ -54,44 +54,6 @@ void WebContextMenuClient::contextMenuDestroyed()
     delete this;
 }
 
-static bool isPreInspectElementTagSafari(IWebUIDelegate* uiDelegate)
-{
-    if (!uiDelegate)
-        return false;
-
-    TCHAR modulePath[MAX_PATH];
-    DWORD length = ::GetModuleFileName(0, modulePath, WTF_ARRAY_LENGTH(modulePath));
-    if (!length)
-        return false;
-
-    return String(modulePath, length).endsWith("Safari.exe", false);
-}
-
-static HMENU fixMenuReceivedFromOldSafari(IWebUIDelegate* uiDelegate, ContextMenu* originalMenu, HMENU menuFromClient)
-{
-    ASSERT_ARG(originalMenu, originalMenu);
-    if (!isPreInspectElementTagSafari(uiDelegate))
-        return menuFromClient;
-
-    int count = ::GetMenuItemCount(originalMenu->platformDescription());
-    if (count < 1)
-        return menuFromClient;
-
-    if (::GetMenuItemID(originalMenu->platformDescription(), count - 1) != WebMenuItemTagInspectElement)
-        return menuFromClient;
-
-    count = ::GetMenuItemCount(menuFromClient);
-    if (count < 1)
-        return menuFromClient;
-
-    if (::GetMenuItemID(menuFromClient, count - 1) == WebMenuItemTagInspectElement)
-        return menuFromClient;
-
-    originalMenu->setPlatformDescription(menuFromClient);
-    originalMenu->addInspectElementItem();
-    return originalMenu->platformDescription();
-}
-
 HMENU WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu)
 {
     COMPtr<IWebUIDelegate> uiDelegate;
@@ -106,7 +68,7 @@ HMENU WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu)
     // FIXME: We need to decide whether to do the default before calling this delegate method
     if (FAILED(uiDelegate->contextMenuItemsForElement(m_webView, propertyBag.get(), (OLE_HANDLE)(ULONG64)menu->platformDescription(), (OLE_HANDLE*)&newMenu)))
         return menu->platformDescription();
-    return fixMenuReceivedFromOldSafari(uiDelegate.get(), menu, newMenu);
+    return newMenu;
 }
 
 void WebContextMenuClient::contextMenuItemSelected(ContextMenuItem* item, const ContextMenu* parentMenu)