mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-08 20:12:01 +03:00
Page info: Get URL scheme on creation.
This commit is contained in:
parent
6fe2f7de47
commit
b2f4f278be
@ -241,6 +241,7 @@ struct page_info {
|
||||
|
||||
struct browser_window *bw;
|
||||
lwc_string *domain;
|
||||
enum nsurl_scheme_type scheme;
|
||||
|
||||
browser_window_page_info_state state;
|
||||
unsigned cookies;
|
||||
@ -447,6 +448,7 @@ static nserror page_info__create_from_bw(
|
||||
pi->state = browser_window_get_page_info_state(bw);
|
||||
pi->cookies = browser_window_get_cookie_count(bw);
|
||||
pi->domain = nsurl_get_component(url, NSURL_HOST);
|
||||
pi->scheme = nsurl_get_scheme_type(url);
|
||||
|
||||
return page_info__set_text(pi);
|
||||
}
|
||||
@ -462,15 +464,12 @@ 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) {
|
||||
if (i == PI_ENTRY_CERT && pi->scheme != NSURL_SCHEME_HTTPS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -583,7 +582,6 @@ 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,
|
||||
@ -593,8 +591,6 @@ 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);
|
||||
@ -612,7 +608,7 @@ 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) {
|
||||
if (i == PI_ENTRY_CERT && pi->scheme != NSURL_SCHEME_HTTPS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -718,19 +714,16 @@ 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) {
|
||||
if (i == PI_ENTRY_CERT && pi->scheme != NSURL_SCHEME_HTTPS) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user