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. --- content/content.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'content/content.c') diff --git a/content/content.c b/content/content.c index 4641571bd..ee6ff818f 100644 --- a/content/content.c +++ b/content/content.c @@ -795,20 +795,19 @@ char * content_get_selection(hlcache_handle *h) return NULL; } - -void content_get_contextual_content(struct hlcache_handle *h, - int x, int y, struct contextual_content *data) +/* exported interface documented in content/content.h */ +nserror content_get_contextual_content(struct hlcache_handle *h, + int x, int y, struct browser_window_features *data) { struct content *c = hlcache_handle_get_content(h); assert(c != 0); if (c->handler->get_contextual_content != NULL) { - c->handler->get_contextual_content(c, x, y, data); - return; - } else { - data->object = h; - return; + return c->handler->get_contextual_content(c, x, y, data); } + + data->object = h; + return NSERROR_OK; } -- cgit v1.2.3