path: root/cocoa
diff options
authorVincent Sanders <>2014-11-02 15:46:42 +0000
committerVincent Sanders <>2014-11-02 15:46:42 +0000
commitc31c4babe172ab581a3196536d47fc2558a01acd (patch)
tree62d8630490f7969d0e690ba881d7b956e53d7561 /cocoa
parent1794ac0d333acc61eda3424141d4722b7eab9a2b (diff)
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.
Diffstat (limited to 'cocoa')
1 files changed, 4 insertions, 4 deletions
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 ( != NULL) {
+ NSString *target = [NSString stringWithUTF8String: nsurl_access(];
[[popupMenu addItemWithTitle: NSLocalizedString( @"Open link in new tab", @"Context menu" )
action: @selector(cmOpenURLInTab:)