#include "libublsettings-gtk3.h"
#ifdef WEBKIT_INCLUDE

GtkWidget *yon_ubl_browser_window_open(char *link, char *browser_window_name){
    GtkWidget *browser=gtk_window_new(GTK_WINDOW_TOPLEVEL);
    GtkWidget *web_place=gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
    GtkWidget *header=gtk_header_bar_new();
    GtkWidget *header_label=gtk_label_new(browser_window_name);
    GtkWidget *WebView=webkit_web_view_new();
    gtk_container_add(GTK_CONTAINER(browser),web_place);
    gtk_window_set_titlebar(GTK_WINDOW(browser),header);
    gtk_window_set_title(GTK_WINDOW(browser),browser_window_name);
    gtk_widget_set_size_request(browser,800,600);
    gtk_header_bar_set_custom_title(GTK_HEADER_BAR(header),header_label);
    gtk_header_bar_set_show_close_button(GTK_HEADER_BAR(header),1);
    webkit_web_view_load_uri(WEBKIT_WEB_VIEW(WebView),link);
    gtk_box_pack_start(GTK_BOX(web_place),WebView,1,1,0);
    gtk_widget_show_all(browser);
    return browser;
}
#else

GtkWidget *yon_ubl_browser_window_open(char *link,  char *browser_window_name){
        char *user=yon_ubl_root_user_get();
        char *command=yon_char_unite("sudo -u ",user," xdg-open ", link,NULL);
        yon_launch(command);
        return NULL;
}
#endif