WebCore:
authoraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Nov 2006 06:43:58 +0000 (06:43 +0000)
committeraroben <aroben@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 16 Nov 2006 06:43:58 +0000 (06:43 +0000)
commitbaecfcdcef084e7eaa7ba41f03e17f4f0693e333
tree4ae8d0f7402367b7a42b36e1f9beea345ecfb659
parentd59c5a1e45e584dde62ca42c08660546b8db249b
WebCore:

        Reviewed by Anders.

        Add new ContextMenuController and ContextMenuClient classes, and move
        context menu responsibilities from Chrome and ChromeClient to them.

        * WebCore.exp:
        * WebCore.xcodeproj/project.pbxproj: Add new files to project, and
        alphabetize some others.
        * page/Chrome.cpp: Remove context menu-related code.
        * page/Chrome.h: Ditto.
        * page/ChromeClient.h:
        * page/ContextMenuClient.h: Added.
        * page/ContextMenuController.cpp: Added.
        (WebCore::ContextMenuController::ContextMenuController):
        (WebCore::ContextMenuController::~ContextMenuController):
        (WebCore::ContextMenuController::handleContextMenuEvent):
        (WebCore::ContextMenuController::contextMenuActionSelected):
        * page/ContextMenuController.h: Added.
        (WebCore::ContextMenuController::client):
        * page/Page.cpp: Every Page now has a ContextMenuController.
        (WebCore::Page::Page):
        * page/Page.h: Made m_dragCaretController and m_chrome objects instead
        of pointers to objects.
        (WebCore::Page::contextMenuController):
        * platform/ContextMenu.cpp:
        (WebCore::ContextMenu::populate): Removed the call to Chrome to ask the
        delegate to add its menu items, and moved the code from the static
        addDefaultItems function into this method.
        * platform/ContextMenu.h:
        (WebCore::ContextMenu::show): Added an empty method body since this
        method is now called from ContextMenuController (although no one calls
        into ContextMenuController yet, so it's OK for this to be empty).
        (WebCore::ContextMenu::hide): Ditto.

WebKit:

        Reviewed by Anders.

        Added new WebContextMenuClient class to act as WebCore's ChromeClient,
        and moved context menu-related code there from WebChromeClient.

        * WebCoreSupport/WebChromeClient.h:
        * WebCoreSupport/WebChromeClient.mm:
        * WebCoreSupport/WebContextMenuClient.h: Added.
        (WebContextMenuClient::webView):
        * WebCoreSupport/WebContextMenuClient.mm: Added.
        (WebContextMenuClient::create):
        (WebContextMenuClient::WebContextMenuClient):
        (WebContextMenuClient::ref):
        (WebContextMenuClient::deref):
        (WebContextMenuClient::addCustomContextMenuItems):
        * WebKit.xcodeproj/project.pbxproj: Added new files.
        * WebView/WebView.mm:
        (-[WebView _commonInitializationWithFrameName:groupName:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@17805 268f45cc-cd09-0410-ab3c-d52691b4dbfc
20 files changed:
WebCore/ChangeLog
WebCore/WebCore.exp
WebCore/WebCore.xcodeproj/project.pbxproj
WebCore/page/Chrome.cpp
WebCore/page/Chrome.h
WebCore/page/ChromeClient.h
WebCore/page/ContextMenuClient.h [new file with mode: 0644]
WebCore/page/ContextMenuController.cpp [new file with mode: 0644]
WebCore/page/ContextMenuController.h [new file with mode: 0644]
WebCore/page/Page.cpp
WebCore/page/Page.h
WebCore/platform/ContextMenu.cpp
WebCore/platform/ContextMenu.h
WebKit/ChangeLog
WebKit/WebCoreSupport/WebChromeClient.h
WebKit/WebCoreSupport/WebChromeClient.mm
WebKit/WebCoreSupport/WebContextMenuClient.h [new file with mode: 0644]
WebKit/WebCoreSupport/WebContextMenuClient.mm [new file with mode: 0644]
WebKit/WebKit.xcodeproj/project.pbxproj
WebKit/WebView/WebView.mm