diff options
author | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-11-06 20:53:27 -0600 |
---|---|---|
committer | Michael Catanzaro <mcatanzaro@gnome.org> | 2016-11-06 20:53:27 -0600 |
commit | 192582945fa64add29041145e29a1b6667146495 (patch) | |
tree | fd5a07a1ea2175c81173a519703baacab31b22b2 /lib | |
parent | 8896421b6cd7a9b8fcc5a151d0efc106b696ad74 (diff) | |
download | epiphany-192582945fa64add29041145e29a1b6667146495.tar.gz |
Remember geolocation permission requests
Just like we do notification permission requests
Diffstat (limited to 'lib')
-rw-r--r-- | lib/ephy-hosts-manager.c | 22 | ||||
-rw-r--r-- | lib/ephy-hosts-manager.h | 3 |
2 files changed, 24 insertions, 1 deletions
diff --git a/lib/ephy-hosts-manager.c b/lib/ephy-hosts-manager.c index 235ef93ac..cb3b06bc2 100644 --- a/lib/ephy-hosts-manager.c +++ b/lib/ephy-hosts-manager.c @@ -169,6 +169,23 @@ ephy_hosts_manager_set_save_password_permission_for_address (EphyHostsManager g_settings_set_enum (settings, "save-password-permission", permission); } +static EphyHostPermission +ephy_hosts_manager_get_geolocation_permission_for_address (EphyHostsManager *manager, + const char *address) +{ + GSettings *settings = ephy_hosts_manager_get_settings_for_address (manager, address); + return g_settings_get_enum (settings, "geolocation-permission"); +} + +static void +ephy_hosts_manager_set_geolocation_permission_for_address (EphyHostsManager *manager, + const char *address, + EphyHostPermission permission) +{ + GSettings *settings = ephy_hosts_manager_get_settings_for_address (manager, address); + g_settings_set_enum (settings, "geolocation-permission", permission); +} + EphyHostPermission ephy_hosts_manager_get_permission_for_address (EphyHostsManager *manager, EphyHostPermissionType type, @@ -179,6 +196,8 @@ ephy_hosts_manager_get_permission_for_address (EphyHostsManager *manager, return ephy_hosts_manager_get_notifications_permission_for_address (manager, address); case EPHY_HOST_PERMISSION_TYPE_SAVE_PASSWORD: return ephy_hosts_manager_get_save_password_permission_for_address (manager, address); + case EPHY_HOST_PERMISSION_TYPE_ACCESS_LOCATION: + return ephy_hosts_manager_get_geolocation_permission_for_address (manager, address); default: g_assert_not_reached (); } @@ -197,6 +216,9 @@ ephy_hosts_manager_set_permission_for_address (EphyHostsManager *manager, case EPHY_HOST_PERMISSION_TYPE_SAVE_PASSWORD: ephy_hosts_manager_set_save_password_permission_for_address (manager, address, permission); break; + case EPHY_HOST_PERMISSION_TYPE_ACCESS_LOCATION: + ephy_hosts_manager_set_geolocation_permission_for_address (manager, address, permission); + break; default: g_assert_not_reached (); } diff --git a/lib/ephy-hosts-manager.h b/lib/ephy-hosts-manager.h index 285ed571f..0468deef3 100644 --- a/lib/ephy-hosts-manager.h +++ b/lib/ephy-hosts-manager.h @@ -37,7 +37,8 @@ typedef enum { typedef enum { EPHY_HOST_PERMISSION_TYPE_SHOW_NOTIFICATIONS, - EPHY_HOST_PERMISSION_TYPE_SAVE_PASSWORD + EPHY_HOST_PERMISSION_TYPE_SAVE_PASSWORD, + EPHY_HOST_PERMISSION_TYPE_ACCESS_LOCATION } EphyHostPermissionType; EphyHostsManager* ephy_hosts_manager_new (void); |