From da84e1a00a123f91e485d9c318b8dabca50f2429 Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Mon, 12 Aug 2013 10:32:54 +0100 Subject: [PATCH] Add SSL cert handling to treeview test hack. --- desktop/tree.c | 26 ++++++++++++++++++++++++++ desktop/tree.h | 4 ++++ 2 files changed, 30 insertions(+) diff --git a/desktop/tree.c b/desktop/tree.c index 7cac1cbda..a219c8321 100644 --- a/desktop/tree.c +++ b/desktop/tree.c @@ -179,6 +179,7 @@ struct tree { #include "desktop/treeview.h" #include "desktop/cookie_manager.h" #include "desktop/global_history.h" +#include "desktop/sslcert_viewer.h" int treeview_inits; @@ -258,6 +259,13 @@ static bool treeview_test_init(struct tree *tree) warn_user("Couldn't init new global history.", 0); } } + if (tree->flags & TREE_SSLCERT) { + err = sslcert_viewer_init(&cw_t, (struct core_window *)tree, + ssl_current_session); + if (err != NSERROR_OK) { + warn_user("Couldn't init new sslcert viewer.", 0); + } + } return true; } @@ -281,6 +289,12 @@ static bool treeview_test_fini(struct tree *tree) warn_user("Couldn't finalise cookie manager.", 0); } } + if (tree->flags & TREE_SSLCERT) { + err = sslcert_viewer_fini(ssl_current_session); + if (err != NSERROR_OK) { + warn_user("Couldn't finalise sslcert viewer.", 0); + } + } if (treeview_inits == 1) treeview_fini(); @@ -311,6 +325,10 @@ static bool treeview_test_redraw(struct tree *tree, int x, int y, global_history_redraw(x, y, &clip, ctx); return true; } + if (tree->flags & TREE_SSLCERT) { + sslcert_viewer_redraw(ssl_current_session, x, y, &clip, ctx); + return true; + } return false; } @@ -329,6 +347,10 @@ static bool treeview_test_mouse_action(struct tree *tree, global_history_mouse_action(mouse, x, y); return true; } + if (tree->flags & TREE_SSLCERT) { + sslcert_viewer_mouse_action(ssl_current_session, mouse, x, y); + return true; + } return false; } @@ -346,6 +368,10 @@ static bool treeview_test_keypress(struct tree *tree, uint32_t key) global_history_keypress(key); return true; } + if (tree->flags & TREE_SSLCERT) { + sslcert_viewer_keypress(ssl_current_session, key); + return true; + } return false; } diff --git a/desktop/tree.h b/desktop/tree.h index 7074f6090..a69a537e9 100644 --- a/desktop/tree.h +++ b/desktop/tree.h @@ -30,6 +30,10 @@ #include "desktop/browser.h" #include "image/bitmap.h" +struct sslcert_session_data; +struct sslcert_session_data *ssl_current_session; + + struct hlcache_handle; /* Tree flags */