From 21bbda23fa27561e8f52daff1adb2403c4e86019 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 24 Feb 2020 08:55:26 +0000 Subject: Browser window: Set the search string on show cookies. We still need to tell the front end to open the cookies window. --- desktop/browser_window.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'desktop') diff --git a/desktop/browser_window.c b/desktop/browser_window.c index bdf48b30e..9d8e27605 100644 --- a/desktop/browser_window.c +++ b/desktop/browser_window.c @@ -57,6 +57,7 @@ #include "html/box.h" #include "javascript/js.h" +#include "desktop/cookie_manager.h" #include "desktop/browser_history.h" #include "desktop/browser_private.h" #include "desktop/download.h" @@ -4745,8 +4746,19 @@ int browser_window_get_cookie_count( nserror browser_window_show_cookies( const struct browser_window *bw) { - /** \todo Implement show cookies */ - return NSERROR_OK; + nserror err; + nsurl *url = browser_window_access_url(bw); + 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); + + if (host != NULL) { + lwc_string_unref(host); + } + return err; } /* Exported interface, documented in browser_window.h */ -- cgit v1.2.3