From c31c4babe172ab581a3196536d47fc2558a01acd Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Sun, 2 Nov 2014 15:46:42 +0000 Subject: Change contextual content retrieval to browser features. Update the API which allows frontends to acquire the page features (images, link urls or form elements) present at the given coordinates within a browser window. By making this an explicit browser_window API and using the browser.h header for the associated data structure with a more appropriate API naming the usage is much more obvious and contained. Additionally the link url is now passed around as a nsurl stopping it being converted from nsurl to text and back again several times. --- cocoa/BrowserView.m | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'cocoa') diff --git a/cocoa/BrowserView.m b/cocoa/BrowserView.m index 2a3382c8c..d07cb5411 100644 --- a/cocoa/BrowserView.m +++ b/cocoa/BrowserView.m @@ -490,9 +490,9 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) NSMenu *popupMenu = [[NSMenu alloc] initWithTitle: @""]; NSPoint point = [self convertMousePoint: event]; - struct contextual_content cont; + struct browser_window_features; - browser_window_get_contextual_content( browser, point.x, point.y, &cont); + browser_window_get_features(browser, point.x, point.y, &cont); if (cont.object != NULL) { NSString *imageURL = [NSString stringWithUTF8String: nsurl_access(hlcache_handle_get_url( cont.object ))]; @@ -513,8 +513,8 @@ static browser_mouse_state cocoa_mouse_flags_for_event( NSEvent *evt ) [popupMenu addItem: [NSMenuItem separatorItem]]; } - if (cont.link_url != NULL) { - NSString *target = [NSString stringWithUTF8String: cont.link_url]; + if (cont.link != NULL) { + NSString *target = [NSString stringWithUTF8String: nsurl_access(cont.link)]; [[popupMenu addItemWithTitle: NSLocalizedString( @"Open link in new tab", @"Context menu" ) action: @selector(cmOpenURLInTab:) -- cgit v1.2.3