Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2007 21:17:25 +0000 (21:17 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 17 Jul 2007 21:17:25 +0000 (21:17 +0000)
commitc9f47572edcf2d2f48b63b2c5d12f2e611e63745
tree7f826423faa77092b66c806130475630953c2b23
parentf6e70398753d3230b50a056fee154b4cd6ba42e2
Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item

WebCore:

        Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
        http://bugs.webkit.org/show_bug.cgi?id=14324

        Reviewed by Tim.

        No regression test possible.

        * page/ContextMenuController.cpp:
        (WebCore::ContextMenuController::handleContextMenuEvent): Add the
        Inspect Element item to the menu before passing it to the
        ContextMenuClient so that the UI delegate has a chance to
        modify/remove the item.

WebKit:

        Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
        http://bugs.webkit.org/show_bug.cgi?id=14324

        Only clients linking against new versions of WebKit will see the item.
        I've maintained our behavior for old clients of not including the
        Inspect Element item in the menu items passed to the UI delegate.

        Reviewed by Tim.

        * Misc/WebKitVersionChecks.h: Added a new constant.
        * WebCoreSupport/WebContextMenuClient.mm:
        (isPreInspectElementTagClient): Added.
        (fixMenusToSendToOldClients): Return an array of items that should be
        appended to the menu received from the delegate.
        (fixMenusReceivedFromOldClients): Append the saved items to the array.
        (WebContextMenuClient::getCustomMenuFromDefaultItems): Retain/release
        the saved items.

WebKit/win:

        Fix Bug 14324: Cannot remove/customize the "Inspect Element" contextual menu item
        http://bugs.webkit.org/show_bug.cgi?id=14324

        If we detect that we're running against the Safari 3 Beta, we add back
        the Inspect Element menu item after passing it off to the delegate
        because Safari's UI delegate will remove it.

        Reviewed by Tim.

        * WebContextMenuClient.cpp:
        (isPreInspectElementTagSafari): Added.
        (fixMenuReceivedFromOldSafari): Added.
        (WebContextMenuClient::getCustomMenuFromDefaultItems): Call
        fixMenuReceivedFromOldSafari before returning the new menu.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@24381 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog
WebCore/page/ContextMenuController.cpp
WebKit/ChangeLog
WebKit/Misc/WebKitVersionChecks.h
WebKit/WebCoreSupport/WebContextMenuClient.mm
WebKit/win/ChangeLog
WebKit/win/WebContextMenuClient.cpp