From b112dec78d5e8289ded3f61db96e495690ae96b5 Mon Sep 17 00:00:00 2001 From: Vincent Sanders Date: Thu, 14 Feb 2013 18:21:11 +0000 Subject: change browser_window_create and refactor all callsites --- monkey/browser.c | 24 +++++++++++++++++++++--- 1 file changed, 21 insertions(+), 3 deletions(-) (limited to 'monkey') diff --git a/monkey/browser.c b/monkey/browser.c index a4a923fac..c73e0c0ef 100644 --- a/monkey/browser.c +++ b/monkey/browser.c @@ -394,11 +394,29 @@ gui_window_save_link(struct gui_window *g, const char *url, static void monkey_window_handle_new(int argc, char **argv) { - struct browser_window *bw; + nsurl *url = NULL; + nserror error = NSERROR_OK; + if (argc > 3) return; - bw = browser_window_create((argc == 3) ? argv[2] : NULL, NULL, NULL, true, false); - (void) bw; + + if (argc == 3) { + error = nsurl_create(argv[2], &url); + } + if (error == NSERROR_OK) { + error = browser_window_create(BROWSER_WINDOW_GO_FLAG_VERIFIABLE | + BROWSER_WINDOW_GO_FLAG_HISTORY, + url, + NULL, + NULL, + NULL); + if (url != NULL) { + nsurl_unref(url); + } + } + if (error != NSERROR_OK) { + warn_user(messages_get_errorcode(error), 0); + } } static void -- cgit v1.2.3