⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 169079 in webkit


Ignore:
Timestamp:
May 19, 2014, 3:41:18 PM (12 years ago)
Author:
beidson@apple.com
Message:

Use different AppKit API for image control menus.
<rdar://problem/16807828> and ​https://bugs.webkit.org/show_bug.cgi?id=133087

Reviewed by Tim Horton.

For image control menus, use popUpMenuPositioningItem: instead of popUpContextMenu:

  • WebCoreSupport/WebContextMenuClient.h:
  • WebCoreSupport/WebContextMenuClient.mm:

(WebContextMenuClient::contextMenuForEvent):
(WebContextMenuClient::showContextMenu):

Location:
trunk/Source/WebKit/mac
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/mac/ChangeLog

    r169049 r169079  
     12014-05-19  Brady Eidson  <beidson@apple.com>
     2
     3        Use different AppKit API for image control menus.
     4        <rdar://problem/16807828> and https://bugs.webkit.org/show_bug.cgi?id=133087
     5
     6        Reviewed by Tim Horton.
     7
     8        For image control menus, use popUpMenuPositioningItem: instead of popUpContextMenu:
     9       
     10        * WebCoreSupport/WebContextMenuClient.h:
     11        * WebCoreSupport/WebContextMenuClient.mm:
     12        (WebContextMenuClient::contextMenuForEvent):
     13        (WebContextMenuClient::showContextMenu):
     14
    1152014-05-19  Andy Estes  <aestes@apple.com>
    216
  • trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h

    r168859 r169079  
    6666       
    6767private:
    68     NSMenu *contextMenuForEvent(NSEvent *, NSView *);
     68    NSMenu *contextMenuForEvent(NSEvent *, NSView *, bool& isServicesMenu);
    6969
    7070    bool clientFloatRectForNode(WebCore::Node&, WebCore::FloatRect&) const;
  • trunk/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm

    r168859 r169079  
    461461
    462462
    463 NSMenu *WebContextMenuClient::contextMenuForEvent(NSEvent *event, NSView *view)
    464 {
     463NSMenu *WebContextMenuClient::contextMenuForEvent(NSEvent *event, NSView *view, bool& isServicesMenu)
     464{
     465    isServicesMenu = false;
     466
    465467    Page* page = [m_webView page];
    466468    if (!page)
    … …  
    477479        bool isContentEditable = page->contextMenuController().context().hitTestResult().innerNode()->isContentEditable();
    478480        m_sharingServicePickerController = adoptNS([[WebSharingServicePickerController alloc] initWithData:(NSData *)cfData.get() includeEditorServices:isContentEditable menuClient:this]);
    479        
     481
     482        isServicesMenu = true;
    480483        return [m_sharingServicePickerController menu];
    481484    }
    … …  
    502505
    503506    // Show the contextual menu for this event.
    504     if (NSMenu *menu = contextMenuForEvent(event, view))
    505         [NSMenu popUpContextMenu:menu withEvent:event forView:view];
     507    bool isServicesMenu;
     508    if (NSMenu *menu = contextMenuForEvent(event, view, isServicesMenu)) {
     509        if (isServicesMenu)
     510            [menu popUpMenuPositioningItem:nil atLocation:[view convertPoint:point toView:nil] inView:view];
     511        else
     512            [NSMenu popUpContextMenu:menu withEvent:event forView:view];
     513    }
    506514}
    507515
Note: See TracChangeset for help on using the changeset viewer.