summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorDaniel Silverstone <dsilvers@digital-scurf.org>2019-12-01 15:01:24 +0000
committerDaniel Silverstone <dsilvers@digital-scurf.org>2019-12-01 15:01:24 +0000
commit9741df214d7b291c8de40e9b21d4411e523d0bb3 (patch)
tree124a459a6b1ae210d8cee96bb3c3887eaded9844 /include
parent03f72abdb3416fd6fd869beafa03f2c4f3803df0 (diff)
downloadnetsurf-9741df214d7b291c8de40e9b21d4411e523d0bb3.tar.gz
netsurf-9741df214d7b291c8de40e9b21d4411e523d0bb3.tar.bz2
browser_window: Add basic page info state and SSL accessors
In order to begin work on the page info dialog, we need access to the current page's state and SSL chain if available. Signed-off-by: Daniel Silverstone <dsilvers@digital-scurf.org>
Diffstat (limited to 'include')
-rw-r--r--include/netsurf/browser_window.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/include/netsurf/browser_window.h b/include/netsurf/browser_window.h
index 9bb191c3f..98139aa02 100644
--- a/include/netsurf/browser_window.h
+++ b/include/netsurf/browser_window.h
@@ -42,6 +42,7 @@ struct form_control;
struct nsurl;
struct rect;
struct redraw_context;
+struct ssl_cert_info;
enum content_debug;
/**
@@ -58,6 +59,19 @@ typedef enum {
DRAGGING_OTHER
} browser_drag_type;
+/**
+ * Browser window page information states
+ */
+typedef enum {
+ PAGE_STATE_UNKNOWN, /**< Unable to determine */
+ PAGE_STATE_INTERNAL, /**< Page loaded from internal handler */
+ PAGE_STATE_LOCAL, /**< Page loaded from file:/// etc */
+ PAGE_STATE_INSECURE, /**< Insecure page load */
+ PAGE_STATE_SECURE_OVERRIDE, /**< Secure load, but had to override */
+ PAGE_STATE_SECURE_ISSUES, /**< Secure load, but has insecure elements */
+ PAGE_STATE_SECURE, /**< Secure load */
+} browser_window_page_info_state;
+
typedef enum {
BW_EDITOR_NONE = 0, /**< No selection, no editing */
BW_EDITOR_CAN_COPY = (1 << 0), /**< Have selection */
@@ -740,4 +754,35 @@ nserror browser_window_console_log(struct browser_window *bw,
size_t msglen,
browser_window_console_flags flags);
+/**
+ * Request the current browser window page info state.
+ *
+ * The page information state is an indicator enumeration to be used by
+ * frontends to indicate to the user if the page they are viewing is able
+ * to be trusted. This is often shown as a padlock of some kind.
+ *
+ * This is also used by the internal page information corewindow to render
+ * to the user what the situation is.
+ *
+ * \param bw The browser window
+ * \return The state of the browser window
+ */
+browser_window_page_info_state browser_window_get_page_info_state(
+ struct browser_window *bw);
+
+/**
+ * Request the current browser window SSL certificate chain.
+ *
+ * When the page has SSL information, this will retrieve the certificate chain.
+ *
+ * If there is no chain available, this will return NSERROR_NOT_FOUND
+ *
+ * \param bw The browser window
+ * \param num Pointer to be filled out with chain length
+ * \param chain Pointer to be filled out with chain base
+ * \return Whether or not the chain is available
+ */
+nserror browser_window_get_ssl_chain(struct browser_window *bw, size_t *num,
+ struct ssl_cert_info **chain);
+
#endif