Bug 50042 - WK2 Context Menu Items need a user data object and a client callback for selection
Summary: WK2 Context Menu Items need a user data object and a client callback for sele...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit2 (show other bugs)
Version: 528+ (Nightly build)
Hardware: All All
: P2 Normal
Assignee: Brady Eidson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-11-24 14:53 PST by Brady Eidson
Modified: 2010-11-24 17:27 PST (History)
4 users (show)

See Also:


Attachments
Patch v1 (11.07 KB, patch)
2010-11-24 15:15 PST, Brady Eidson
mitz: review+
beidson: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Brady Eidson 2010-11-24 14:53:58 PST
WK2 Context Menu Items need a user data object and a client callback for selection.

For now I think the user data object is only important for "application custom" context menu items.  If we later decide it's important to attach the user data objects to the WebCore items in the WebProcess, that can be done but it requires a large amount of platform-specific goop that we'll have to invent if that's needed.
Comment 1 Brady Eidson 2010-11-24 15:15:43 PST
Created attachment 74801 [details]
Patch v1
Comment 2 mitz 2010-11-24 16:50:48 PST
Comment on attachment 74801 [details]
Patch v1

View in context: https://bugs.webkit.org/attachment.cgi?id=74801&action=review

> WebKit2/UIProcess/WebPageContextMenuClient.h:42
> +    void customContextMenuItemSelected(WebPageProxy* page, const WebContextMenuItemData&);

Can omit “page” here.

> WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm:92
> +        item.setUserData([static_cast<WebUserDataWrapper*>(representedObject) userData]);

Needs a space before the *.

> WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm:144
> +                WebUserDataWrapper* wrapper = [[WebUserDataWrapper alloc] initWithUserData:items[i].userData()];

Ditto.
Comment 3 John Sullivan 2010-11-24 16:53:11 PST
Also missing a call to [super init] in the implementation of [WebUserDataWrapper initWithUserData:].
Comment 4 Brady Eidson 2010-11-24 16:53:31 PST
Landed in r72707
Comment 5 Brady Eidson 2010-11-24 17:09:46 PST
Whoops, sorry about that John, had already prepped and typed the magic command when your feedback came through.

I followed up with r72709
Comment 6 WebKit Review Bot 2010-11-24 17:27:47 PST
http://trac.webkit.org/changeset/72707 might have broken GTK Linux 32-bit Release
The following tests are not passing:
inspector/extensions.html