Gitweb links:
...log
http://git.netsurf-browser.org/netsurf.git/shortlog/605234c3d23279419df72b0e553509ca95490769
...commit
http://git.netsurf-browser.org/netsurf.git/commit/605234c3d23279419df72b0e553509ca95490769
...tree
http://git.netsurf-browser.org/netsurf.git/tree/605234c3d23279419df72b0e553509ca95490769
The branch, master has been updated
via 605234c3d23279419df72b0e553509ca95490769 (commit)
via 1347f9e3a66dfab4813099f979cb2668e0a29e11 (commit)
from 20d46406ed0f5abbca57e13360bec4c17495c999 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=605234c3d23279419df72b0e553509ca95490769
commit 605234c3d23279419df72b0e553509ca95490769
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
Page info: Only show certificate if scheme is https.
diff --git a/desktop/page-info.c b/desktop/page-info.c
index 79701d2f..6467b60 100644
--- a/desktop/page-info.c
+++ b/desktop/page-info.c
@@ -462,11 +462,18 @@ static nserror page_info__layout(
{
int cur_y = 0;
int max_x = 0;
+ enum nsurl_scheme_type scheme;
+
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
cur_y += pi->window_padding;
for (unsigned i = 0; i < PI_ENTRY__COUNT; i++) {
struct page_info_entry *entry = pi->entries + i;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
cur_y += entry->u.text.height;
@@ -576,6 +583,7 @@ nserror page_info_redraw(
const struct redraw_context *ctx)
{
struct redraw_context new_ctx = *ctx;
+ enum nsurl_scheme_type scheme;
struct rect r = {
.x0 = clip->x0 + x,
.y0 = clip->y0 + y,
@@ -585,6 +593,8 @@ nserror page_info_redraw(
int cur_y = 0;
nserror err;
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
+
/* Start knockout rendering if it's available for this plotter. */
if (ctx->plot->option_knockout) {
bool res = knockout_plot_start(ctx, &new_ctx);
@@ -602,6 +612,10 @@ nserror page_info_redraw(
const struct page_info_entry *entry = pi->entries + i;
int cur_x = pi->window_padding;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
err = page_info__redraw_text_entry(
@@ -704,15 +718,22 @@ nserror page_info_mouse_action(
int y,
bool *did_something)
{
+ enum nsurl_scheme_type scheme;
int cur_y = 0;
nserror err;
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
+
cur_y += pi->window_padding;
for (unsigned i = 0; i < PI_ENTRY__COUNT; i++) {
struct page_info_entry *entry = pi->entries + i;
bool hovering = false;
int height;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
cur_y += entry->u.text.height;
commitdiff
http://git.netsurf-browser.org/netsurf.git/commit/?id=1347f9e3a66dfab4813099f979cb2668e0a29e11
commit 1347f9e3a66dfab4813099f979cb2668e0a29e11
Author: Michael Drake <[email protected]>
Commit: Michael Drake <[email protected]>
nsurl: Expose scheme type accessor.
diff --git a/utils/nsurl.h b/utils/nsurl.h
index a80deef..fcae12e 100644
--- a/utils/nsurl.h
+++ b/utils/nsurl.h
@@ -30,6 +30,16 @@
/** NetSurf URL object */
typedef struct nsurl nsurl;
+/** A type for URL schemes */
+enum nsurl_scheme_type {
+ NSURL_SCHEME_OTHER,
+ NSURL_SCHEME_HTTP,
+ NSURL_SCHEME_HTTPS,
+ NSURL_SCHEME_FILE,
+ NSURL_SCHEME_FTP,
+ NSURL_SCHEME_MAILTO,
+ NSURL_SCHEME_DATA
+};
typedef enum nsurl_component {
NSURL_SCHEME = (1 << 0),
@@ -146,6 +156,15 @@ lwc_string *nsurl_get_component(const nsurl *url,
nsurl_component part);
/**
+ * Get the scheme type from a NetSurf URL object
+ *
+ * \param url NetSurf URL object
+ * \return The URL scheme type.
+ */
+enum nsurl_scheme_type nsurl_get_scheme_type(const nsurl *url);
+
+
+/**
* Enquire about the existence of componenets in a given URL
*
* \param url NetSurf URL object
diff --git a/utils/nsurl/nsurl.c b/utils/nsurl/nsurl.c
index 50cc15e..63619af 100644
--- a/utils/nsurl/nsurl.c
+++ b/utils/nsurl/nsurl.c
@@ -237,6 +237,15 @@ lwc_string *nsurl_get_component(const nsurl *url,
nsurl_component part)
/* exported interface, documented in nsurl.h */
+enum nsurl_scheme_type nsurl_get_scheme_type(const nsurl *url)
+{
+ assert(url != NULL);
+
+ return url->components.scheme_type;
+}
+
+
+/* exported interface, documented in nsurl.h */
bool nsurl_has_component(const nsurl *url, nsurl_component part)
{
assert(url != NULL);
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h
index 08973e5..b099a45 100644
--- a/utils/nsurl/private.h
+++ b/utils/nsurl/private.h
@@ -25,18 +25,6 @@
#include "utils/utils.h"
-/** A type for URL schemes */
-enum nsurl_scheme_type {
- NSURL_SCHEME_OTHER,
- NSURL_SCHEME_HTTP,
- NSURL_SCHEME_HTTPS,
- NSURL_SCHEME_FILE,
- NSURL_SCHEME_FTP,
- NSURL_SCHEME_MAILTO,
- NSURL_SCHEME_DATA
-};
-
-
/**
* nsurl components
*
-----------------------------------------------------------------------
Summary of changes:
desktop/page-info.c | 21 +++++++++++++++++++++
utils/nsurl.h | 19 +++++++++++++++++++
utils/nsurl/nsurl.c | 9 +++++++++
utils/nsurl/private.h | 12 ------------
4 files changed, 49 insertions(+), 12 deletions(-)
diff --git a/desktop/page-info.c b/desktop/page-info.c
index 79701d2f..6467b60 100644
--- a/desktop/page-info.c
+++ b/desktop/page-info.c
@@ -462,11 +462,18 @@ static nserror page_info__layout(
{
int cur_y = 0;
int max_x = 0;
+ enum nsurl_scheme_type scheme;
+
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
cur_y += pi->window_padding;
for (unsigned i = 0; i < PI_ENTRY__COUNT; i++) {
struct page_info_entry *entry = pi->entries + i;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
cur_y += entry->u.text.height;
@@ -576,6 +583,7 @@ nserror page_info_redraw(
const struct redraw_context *ctx)
{
struct redraw_context new_ctx = *ctx;
+ enum nsurl_scheme_type scheme;
struct rect r = {
.x0 = clip->x0 + x,
.y0 = clip->y0 + y,
@@ -585,6 +593,8 @@ nserror page_info_redraw(
int cur_y = 0;
nserror err;
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
+
/* Start knockout rendering if it's available for this plotter. */
if (ctx->plot->option_knockout) {
bool res = knockout_plot_start(ctx, &new_ctx);
@@ -602,6 +612,10 @@ nserror page_info_redraw(
const struct page_info_entry *entry = pi->entries + i;
int cur_x = pi->window_padding;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
err = page_info__redraw_text_entry(
@@ -704,15 +718,22 @@ nserror page_info_mouse_action(
int y,
bool *did_something)
{
+ enum nsurl_scheme_type scheme;
int cur_y = 0;
nserror err;
+ scheme = nsurl_get_scheme_type(browser_window_access_url(pi->bw));
+
cur_y += pi->window_padding;
for (unsigned i = 0; i < PI_ENTRY__COUNT; i++) {
struct page_info_entry *entry = pi->entries + i;
bool hovering = false;
int height;
+ if (i == PI_ENTRY_CERT && scheme != NSURL_SCHEME_HTTPS) {
+ continue;
+ }
+
switch (entry->type) {
case PAGE_INFO_ENTRY_TYPE_TEXT:
cur_y += entry->u.text.height;
diff --git a/utils/nsurl.h b/utils/nsurl.h
index a80deef..fcae12e 100644
--- a/utils/nsurl.h
+++ b/utils/nsurl.h
@@ -30,6 +30,16 @@
/** NetSurf URL object */
typedef struct nsurl nsurl;
+/** A type for URL schemes */
+enum nsurl_scheme_type {
+ NSURL_SCHEME_OTHER,
+ NSURL_SCHEME_HTTP,
+ NSURL_SCHEME_HTTPS,
+ NSURL_SCHEME_FILE,
+ NSURL_SCHEME_FTP,
+ NSURL_SCHEME_MAILTO,
+ NSURL_SCHEME_DATA
+};
typedef enum nsurl_component {
NSURL_SCHEME = (1 << 0),
@@ -146,6 +156,15 @@ lwc_string *nsurl_get_component(const nsurl *url,
nsurl_component part);
/**
+ * Get the scheme type from a NetSurf URL object
+ *
+ * \param url NetSurf URL object
+ * \return The URL scheme type.
+ */
+enum nsurl_scheme_type nsurl_get_scheme_type(const nsurl *url);
+
+
+/**
* Enquire about the existence of componenets in a given URL
*
* \param url NetSurf URL object
diff --git a/utils/nsurl/nsurl.c b/utils/nsurl/nsurl.c
index 50cc15e..63619af 100644
--- a/utils/nsurl/nsurl.c
+++ b/utils/nsurl/nsurl.c
@@ -237,6 +237,15 @@ lwc_string *nsurl_get_component(const nsurl *url,
nsurl_component part)
/* exported interface, documented in nsurl.h */
+enum nsurl_scheme_type nsurl_get_scheme_type(const nsurl *url)
+{
+ assert(url != NULL);
+
+ return url->components.scheme_type;
+}
+
+
+/* exported interface, documented in nsurl.h */
bool nsurl_has_component(const nsurl *url, nsurl_component part)
{
assert(url != NULL);
diff --git a/utils/nsurl/private.h b/utils/nsurl/private.h
index 08973e5..b099a45 100644
--- a/utils/nsurl/private.h
+++ b/utils/nsurl/private.h
@@ -25,18 +25,6 @@
#include "utils/utils.h"
-/** A type for URL schemes */
-enum nsurl_scheme_type {
- NSURL_SCHEME_OTHER,
- NSURL_SCHEME_HTTP,
- NSURL_SCHEME_HTTPS,
- NSURL_SCHEME_FILE,
- NSURL_SCHEME_FTP,
- NSURL_SCHEME_MAILTO,
- NSURL_SCHEME_DATA
-};
-
-
/**
* nsurl components
*
--
NetSurf Browser
_______________________________________________
netsurf-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]