mirror of
https://github.com/netsurf-browser/netsurf
synced 2024-12-24 04:56:50 +03:00
misc: Add a present_cookies to guit->misc and use it
In order that we present the cookies window usefully, change browser_window to request presentation of the cookies window via a gui misc callback. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
This commit is contained in:
parent
cafb428a49
commit
26df6ab7dd
@ -4802,9 +4802,7 @@ nserror browser_window_show_cookies(
|
||||
lwc_string *host = nsurl_get_component(url, NSURL_HOST);
|
||||
const char *string = (host != NULL) ? lwc_string_data(host) : NULL;
|
||||
|
||||
/** \todo Ensure cookie manager is open. (Ask front end.) */
|
||||
|
||||
err = cookie_manager_set_search_string(string);
|
||||
err = guit->misc->present_cookies(string);
|
||||
|
||||
if (host != NULL) {
|
||||
lwc_string_unref(host);
|
||||
|
@ -657,6 +657,12 @@ gui_default_pdf_password(char **owner_pass, char **user_pass, char *path)
|
||||
save_pdf(path);
|
||||
}
|
||||
|
||||
static nserror
|
||||
gui_default_present_cookies(const char *search_term)
|
||||
{
|
||||
return NSERROR_NOT_IMPLEMENTED;
|
||||
}
|
||||
|
||||
/** verify misc table is valid */
|
||||
static nserror verify_misc_register(struct gui_misc_table *gmt)
|
||||
{
|
||||
@ -683,6 +689,9 @@ static nserror verify_misc_register(struct gui_misc_table *gmt)
|
||||
if (gmt->pdf_password == NULL) {
|
||||
gmt->pdf_password = gui_default_pdf_password;
|
||||
}
|
||||
if (gmt->present_cookies == NULL) {
|
||||
gmt->present_cookies = gui_default_present_cookies;
|
||||
}
|
||||
return NSERROR_OK;
|
||||
}
|
||||
|
||||
|
@ -116,6 +116,14 @@ struct gui_misc_table {
|
||||
*/
|
||||
void (*pdf_password)(char **owner_pass, char **user_pass, char *path);
|
||||
|
||||
/**
|
||||
* Request that the cookie manager be displayed
|
||||
*
|
||||
* \param search_term The search term to be set (NULL if no search)
|
||||
*
|
||||
* \return NSERROR_OK on success
|
||||
*/
|
||||
nserror (*present_cookies)(const char *search_term);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user