Changeset 73305 in webkit


Ignore:
Timestamp:
Dec 3, 2010 2:36:04 PM (13 years ago)
Author:
bweinstein@apple.com
Message:

WebContextMenuClient::fixMenuReceivedFromOldSafari is no longer needed on Windows
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):

Location:
trunk/WebKit/win
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebKit/win/ChangeLog

    r73163 r73305  
     12010-12-03  Brian Weinstein  <bweinstein@apple.com>
     2
     3        Reviewed by Brady Eidson.
     4
     5        WebContextMenuClient::fixMenuReceivedFromOldSafari is no longer needed on Windows
     6        https://bugs.webkit.org/show_bug.cgi?id=50486
     7       
     8        Remove the static fixMenuReceivedFromOldSafari and isPreInspectElementTagSafari methods
     9        from WebContextMenuClient. There were there for when WebKit had the Inspect Element context menu
     10        item, but Safari didn't support it. We don't support that old Safari, so that code can go.
     11
     12        * WebCoreSupport/WebContextMenuClient.cpp:
     13        (WebContextMenuClient::getCustomMenuFromDefaultItems):
     14
    1152010-12-02  John Knottenbelt  <jknotten@chromium.org>
    216
  • trunk/WebKit/win/WebCoreSupport/WebContextMenuClient.cpp

    r70460 r73305  
    5555}
    5656
    57 static bool isPreInspectElementTagSafari(IWebUIDelegate* uiDelegate)
    58 {
    59     if (!uiDelegate)
    60         return false;
    61 
    62     TCHAR modulePath[MAX_PATH];
    63     DWORD length = ::GetModuleFileName(0, modulePath, WTF_ARRAY_LENGTH(modulePath));
    64     if (!length)
    65         return false;
    66 
    67     return String(modulePath, length).endsWith("Safari.exe", false);
    68 }
    69 
    70 static HMENU fixMenuReceivedFromOldSafari(IWebUIDelegate* uiDelegate, ContextMenu* originalMenu, HMENU menuFromClient)
    71 {
    72     ASSERT_ARG(originalMenu, originalMenu);
    73     if (!isPreInspectElementTagSafari(uiDelegate))
    74         return menuFromClient;
    75 
    76     int count = ::GetMenuItemCount(originalMenu->platformDescription());
    77     if (count < 1)
    78         return menuFromClient;
    79 
    80     if (::GetMenuItemID(originalMenu->platformDescription(), count - 1) != WebMenuItemTagInspectElement)
    81         return menuFromClient;
    82 
    83     count = ::GetMenuItemCount(menuFromClient);
    84     if (count < 1)
    85         return menuFromClient;
    86 
    87     if (::GetMenuItemID(menuFromClient, count - 1) == WebMenuItemTagInspectElement)
    88         return menuFromClient;
    89 
    90     originalMenu->setPlatformDescription(menuFromClient);
    91     originalMenu->addInspectElementItem();
    92     return originalMenu->platformDescription();
    93 }
    94 
    9557HMENU WebContextMenuClient::getCustomMenuFromDefaultItems(ContextMenu* menu)
    9658{
     
    10769    if (FAILED(uiDelegate->contextMenuItemsForElement(m_webView, propertyBag.get(), (OLE_HANDLE)(ULONG64)menu->platformDescription(), (OLE_HANDLE*)&newMenu)))
    10870        return menu->platformDescription();
    109     return fixMenuReceivedFromOldSafari(uiDelegate.get(), menu, newMenu);
     71    return newMenu;
    11072}
    11173
Note: See TracChangeset for help on using the changeset viewer.