eve: added cookies policy configuration options
This flag allows to set the cookie policies that eve should respect Author: Marco Trevisan (Treviño) <mail@3v1n0.net> SVN revision: 54591
This commit is contained in:
parent
ae47a9d732
commit
07c3ba32d1
|
@ -97,6 +97,7 @@ typedef enum {
|
||||||
EVE_CONFIG_FRAME_FLATTENING,
|
EVE_CONFIG_FRAME_FLATTENING,
|
||||||
EVE_CONFIG_TEXT_ONLY_ZOOM,
|
EVE_CONFIG_TEXT_ONLY_ZOOM,
|
||||||
EVE_CONFIG_MINIMUM_FONT_SIZE,
|
EVE_CONFIG_MINIMUM_FONT_SIZE,
|
||||||
|
EVE_CONFIG_COOKIE_POLICY,
|
||||||
EVE_CONFIG_LAST
|
EVE_CONFIG_LAST
|
||||||
} Eve_Config;
|
} Eve_Config;
|
||||||
|
|
||||||
|
@ -298,6 +299,18 @@ static More_Menu_Item more_menu_config[] =
|
||||||
{ NULL, NULL }
|
{ NULL, NULL }
|
||||||
}
|
}
|
||||||
}}, NULL, ITEM_FLAG_ARROW | ITEM_FLAG_SELECTABLE },
|
}}, NULL, ITEM_FLAG_ARROW | ITEM_FLAG_SELECTABLE },
|
||||||
|
{ ITEM_TYPE_CONFIG, "Cookie policy",
|
||||||
|
(More_Menu_Config[]) {{
|
||||||
|
.type = CONFIG_TYPE_LIST_INT,
|
||||||
|
.conf = EVE_CONFIG_COOKIE_POLICY,
|
||||||
|
.conf_get = config_cookie_policy_get,
|
||||||
|
.conf_set = config_cookie_policy_set,
|
||||||
|
.data = (More_Menu_Config_List_Int[]) {
|
||||||
|
{ "Accept all cookies", EWK_COOKIE_JAR_ACCEPT_ALWAYS, EINA_FALSE },
|
||||||
|
{ "Do not accept third-party cookies", EWK_COOKIE_JAR_ACCEPT_NO_THIRD_PARTY, EINA_TRUE },
|
||||||
|
{ "Never accept", EWK_COOKIE_JAR_ACCEPT_NEVER, EINA_FALSE }
|
||||||
|
}
|
||||||
|
}}, NULL, ITEM_FLAG_ARROW | ITEM_FLAG_SELECTABLE },
|
||||||
{ ITEM_TYPE_LAST, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
{ ITEM_TYPE_LAST, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
||||||
}, NULL, ITEM_FLAG_ARROW },
|
}, NULL, ITEM_FLAG_ARROW },
|
||||||
{ ITEM_TYPE_SEPARATOR, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
{ ITEM_TYPE_SEPARATOR, NULL, NULL, NULL, ITEM_FLAG_NONE },
|
||||||
|
@ -1284,6 +1297,7 @@ chrome_config_apply(Evas_Object *chrome)
|
||||||
ewk_view_zoom_text_only_set(view, config_text_only_zoom_get(config));
|
ewk_view_zoom_text_only_set(view, config_text_only_zoom_get(config));
|
||||||
ewk_view_setting_enable_frame_flattening_set(view, config_frame_flattening_get(config));
|
ewk_view_setting_enable_frame_flattening_set(view, config_frame_flattening_get(config));
|
||||||
ewk_view_setting_font_minimum_size_set(view, config_minimum_font_size_get(config));
|
ewk_view_setting_font_minimum_size_set(view, config_minimum_font_size_get(config));
|
||||||
|
ewk_cookies_policy_set(config_cookie_policy_get(config));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -1373,6 +1387,11 @@ conf_updated(More_Menu_Config *mmc, void *new_value)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
case EVE_CONFIG_COOKIE_POLICY:
|
||||||
|
{
|
||||||
|
ewk_cookies_policy_set((*(Ewk_Cookie_Policy *)new_value));
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#undef SET_PREF_TO_ALL_VIEWS
|
#undef SET_PREF_TO_ALL_VIEWS
|
||||||
|
|
|
@ -26,6 +26,7 @@ struct _Config {
|
||||||
unsigned char text_only_zoom;
|
unsigned char text_only_zoom;
|
||||||
int minimum_font_size;
|
int minimum_font_size;
|
||||||
const char *__eet_filename;
|
const char *__eet_filename;
|
||||||
|
int cookie_policy;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct _Hist_Item {
|
struct _Hist_Item {
|
||||||
|
@ -111,6 +112,7 @@ _config_init(void)
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "frame_flattening", frame_flattening, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "frame_flattening", frame_flattening, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "text_only_zoom", text_only_zoom, EET_T_UCHAR);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "text_only_zoom", text_only_zoom, EET_T_UCHAR);
|
||||||
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "minimum_font_size", minimum_font_size, EET_T_INT);
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "minimum_font_size", minimum_font_size, EET_T_INT);
|
||||||
|
EET_DATA_DESCRIPTOR_ADD_BASIC(_config_descriptor, Config, "cookie_policy", cookie_policy, EET_T_INT);
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline void
|
static inline void
|
||||||
|
@ -122,7 +124,7 @@ _config_shutdown(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
Config *
|
Config *
|
||||||
config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size)
|
config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy)
|
||||||
{
|
{
|
||||||
Config *config = calloc(1, sizeof(Config));
|
Config *config = calloc(1, sizeof(Config));
|
||||||
|
|
||||||
|
@ -147,6 +149,7 @@ config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, uns
|
||||||
config->frame_flattening = frame_flattening;
|
config->frame_flattening = frame_flattening;
|
||||||
config->text_only_zoom = text_only_zoom;
|
config->text_only_zoom = text_only_zoom;
|
||||||
config->minimum_font_size = minimum_font_size;
|
config->minimum_font_size = minimum_font_size;
|
||||||
|
config->cookie_policy = cookie_policy;
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
@ -354,6 +357,19 @@ config_minimum_font_size_set(Config *config, int minimum_font_size)
|
||||||
EINA_SAFETY_ON_NULL_RETURN(config);
|
EINA_SAFETY_ON_NULL_RETURN(config);
|
||||||
config->minimum_font_size = minimum_font_size;
|
config->minimum_font_size = minimum_font_size;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
inline int
|
||||||
|
config_cookie_policy_get(const Config *config)
|
||||||
|
{
|
||||||
|
return config->cookie_policy;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline void
|
||||||
|
config_cookie_policy_set(Config *config, int cookie_policy)
|
||||||
|
{
|
||||||
|
EINA_SAFETY_ON_NULL_RETURN(config);
|
||||||
|
config->cookie_policy = cookie_policy;
|
||||||
|
}
|
||||||
|
|
||||||
Config *
|
Config *
|
||||||
config_load(const char *filename)
|
config_load(const char *filename)
|
||||||
|
|
|
@ -17,7 +17,7 @@ typedef struct _Session_Window Session_Window;
|
||||||
typedef struct _Session Session;
|
typedef struct _Session Session;
|
||||||
|
|
||||||
/* Config */
|
/* Config */
|
||||||
Config *config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size);
|
Config *config_new(unsigned char allow_popup, unsigned char enable_auto_load_images, unsigned char enable_auto_shrink_images, unsigned char enable_javascript, unsigned char enable_mouse_cursor, unsigned char enable_plugins, unsigned char enable_private_mode, unsigned char enable_touch_interface, const char * home_page, const char * proxy, unsigned char restore_state, const char * user_agent, unsigned char frame_flattening, unsigned char text_only_zoom, int minimum_font_size, int cookie_policy);
|
||||||
void config_free(Config *config);
|
void config_free(Config *config);
|
||||||
|
|
||||||
void config_allow_popup_set(Config *config, unsigned char allow_popup);
|
void config_allow_popup_set(Config *config, unsigned char allow_popup);
|
||||||
|
@ -50,6 +50,8 @@ void config_text_only_zoom_set(Config *config, unsigned char text_only_zoom);
|
||||||
unsigned char config_text_only_zoom_get(const Config *config);
|
unsigned char config_text_only_zoom_get(const Config *config);
|
||||||
void config_minimum_font_size_set(Config *config, int minimum_font_size);
|
void config_minimum_font_size_set(Config *config, int minimum_font_size);
|
||||||
int config_minimum_font_size_get(const Config *config);
|
int config_minimum_font_size_get(const Config *config);
|
||||||
|
void config_cookie_policy_set(Config *config, int cookie_policy);
|
||||||
|
int config_cookie_policy_get(const Config *config);
|
||||||
|
|
||||||
Config *config_load(const char *filename);
|
Config *config_load(const char *filename);
|
||||||
Eina_Bool config_save(Config *config, const char *filename);
|
Eina_Bool config_save(Config *config, const char *filename);
|
||||||
|
|
|
@ -726,7 +726,8 @@ elm_main(int argc, char **argv)
|
||||||
user_agent_str,
|
user_agent_str,
|
||||||
EINA_FALSE /* frame_flattening */,
|
EINA_FALSE /* frame_flattening */,
|
||||||
EINA_FALSE /* text_only_zoom */,
|
EINA_FALSE /* text_only_zoom */,
|
||||||
12 /* minimum_font_size */);
|
12 /* minimum_font_size */,
|
||||||
|
ewk_cookies_policy_get());
|
||||||
if (!config_save(config, path))
|
if (!config_save(config, path))
|
||||||
{
|
{
|
||||||
r = -1;
|
r = -1;
|
||||||
|
|
Loading…
Reference in New Issue