[webkit-dev] Question about PopupMenuClient

Adam Roben aroben at apple.com
Thu Jan 7 14:48:09 PST 2010


On Jan 7, 2010, at 5:44 PM, Kenneth Christiansen wrote:

> A co-worker of mine is implementing the ability to reimplement how popup menus (comboboxes) etc will appear from our Qt WebKit API.
> 
> As these UI delegates are per page, we thought about adding a method to our ChromeClientQt like AbstractPopupMenu* createPopupMenu(PopupMenuClient* client), but currently PopupMenuClient has no access to the page so that we can get hold of that.
> 
> I guess that it is not safe to assume that PopupMenuClient::hostWindow() is always a Chrome, so would it be acceptable substituting the PopupMenuClient::hostWindow()  with a PopupMenuClient::page() [1]  method and then change the uses to page->chrome() ?

That would be a layering violation. PopupMenu is part of WebCore's platform layer, and thus should have no knowledge of higher-level WebCore concepts like "Page".

Maybe you could talk to the ChromeClient at a slightly higher level, like from within RenderMenuList/RenderTextControlSingleLine?

-Adam



More information about the webkit-dev mailing list