diff options
author | Gustavo Noronha Silva <gns@gnome.org> | 2009-12-20 08:28:07 +0800 |
---|---|---|
committer | Gustavo Noronha Silva <gns@gnome.org> | 2009-12-20 19:02:09 +0800 |
commit | ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2 (patch) | |
tree | e4af6eeadaa6b59363bb8a82e2413715f62a19a7 /embed | |
parent | 906b29252ccc045ff7f895bcb5fabd2be5d60c92 (diff) | |
download | gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar.gz gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar.bz2 gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar.lz gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar.xz gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.tar.zst gsoc2013-epiphany-ffd3e5041f91ab025d1b55dcf78e8e9d5c8ec3a2.zip |
Restrict number of password infobars to one
Diffstat (limited to 'embed')
-rw-r--r-- | embed/ephy-web-view.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index c95539c96..8ddfaa8df 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -96,6 +96,8 @@ struct _EphyWebViewPrivate { GSList *hidden_popups; GSList *shown_popups; + + GtkWidget *password_info_bar; }; typedef struct { @@ -910,6 +912,7 @@ static void store_password (GtkInfoBar *info_bar, gint response_id, gpointer data) { StorePasswordData *store_data = (StorePasswordData*)data; + EphyWebView *web_view = ephy_embed_get_web_view (store_data->embed); char *uri = store_data->uri; char *name_field_name = store_data->name_field; char *name_field_value = store_data->name_value; @@ -917,6 +920,9 @@ store_password (GtkInfoBar *info_bar, gint response_id, gpointer data) char *password_field_value = store_data->password_value; SoupURI *soup_uri; + /* We are no longer showing a store password infobar */ + web_view->priv->password_info_bar = NULL; + if (response_id != GTK_RESPONSE_YES) { LOG ("Response is %d - not saving.", response_id); store_password_data_free (store_data); @@ -961,6 +967,7 @@ static void request_decision_on_storing (StorePasswordData *store_data) { EphyEmbed *embed = store_data->embed; + EphyWebView *web_view = ephy_embed_get_web_view (embed); GtkWidget *info_bar; GtkWidget *action_area; GtkWidget *button_box; @@ -1001,6 +1008,12 @@ request_decision_on_storing (StorePasswordData *store_data) g_signal_connect (info_bar, "response", G_CALLBACK (store_password), store_data); ephy_embed_add_top_widget (embed, info_bar, FALSE); + + /* We track the info_bar, so we only ever show one */ + if (web_view->priv->password_info_bar) + gtk_widget_destroy (web_view->priv->password_info_bar); + + web_view->priv->password_info_bar = info_bar; } static void |