<?xml version="1.0"?>
<paste-with-annotations>
  <paste>
    <number>
      <integer>92382</integer>
    </number>
    <user>
      <string>kov</string>
    </user>
    <title>
      <string>one infobar for passwords</string>
    </title>
    <contents>
      <string>commit fcfa2556d0d37454ee9ef1a8b761b37a9de0b778
Author: Gustavo Noronha Silva &lt;gns@gnome.org&gt;
Date:   Sun Dec 20 01:28:07 2009 +0100

    Restrict number of password infobars to one

diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index c95539c..8ddfaa8 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-&gt;embed);
   char *uri = store_data-&gt;uri;
   char *name_field_name = store_data-&gt;name_field;
   char *name_field_value = store_data-&gt;name_value;
@@ -917,6 +920,9 @@ store_password (GtkInfoBar *info_bar, gint response_id, gpointer data)
   char *password_field_value = store_data-&gt;password_value;
   SoupURI *soup_uri;
 
+  /* We are no longer showing a store password infobar */
+  web_view-&gt;priv-&gt;password_info_bar = NULL;
+
   if (response_id != GTK_RESPONSE_YES) {
     LOG (&quot;Response is %d - not saving.&quot;, 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-&gt;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, &quot;response&quot;, 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-&gt;priv-&gt;password_info_bar)
+    gtk_widget_destroy (web_view-&gt;priv-&gt;password_info_bar);
+
+  web_view-&gt;priv-&gt;password_info_bar = info_bar;
 }
 
 static void
</string>
    </contents>
    <universal-time>
      <integer>3470294559</integer>
    </universal-time>
    <channel>
      <string>#webkit-gtk</string>
    </channel>
    <colorization-mode>
      <string>WebKit (text or diff)</string>
    </colorization-mode>
    <maybe-spam>
      <null/>
    </maybe-spam>
    <is-unicode>
      <keyword>TRUE</keyword>
    </is-unicode>
    <deletion-requested>
      <null/>
    </deletion-requested>
    <deletion-requested-email>
      <null/>
    </deletion-requested-email>
    <expiration-time>
      <null/>
    </expiration-time>
  </paste>
</paste-with-annotations>
