[ios] Fixes update badge state Bug when saving Password in Modal.

In order to fix it we now call infobarWasAccepted on the badgeDelegate
whenever the credentials were updated/saved.

Bug: 945478
Change-Id: I1f721ee8c5a8dff5644f7008fa25cf4edce12e88
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1580099
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/master@{#653873}
diff --git a/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm b/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm
index 70150bdd..28b1551d 100644
--- a/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm
+++ b/ios/chrome/browser/ui/infobars/coordinators/infobar_password_coordinator.mm
@@ -10,6 +10,7 @@
 #import "ios/chrome/browser/ui/commands/application_commands.h"
 #import "ios/chrome/browser/ui/infobars/banners/infobar_banner_view_controller.h"
 #import "ios/chrome/browser/ui/infobars/coordinators/infobar_coordinator_implementation.h"
+#import "ios/chrome/browser/ui/infobars/infobar_badge_ui_delegate.h"
 #import "ios/chrome/browser/ui/infobars/modals/infobar_password_modal_delegate.h"
 #import "ios/chrome/browser/ui/infobars/modals/infobar_password_table_view_controller.h"
 
@@ -131,6 +132,7 @@
 - (void)updateCredentialsWithUsername:(NSString*)username
                              password:(NSString*)password {
   self.passwordInfoBarDelegate->UpdateCredentials(username, password);
+  [self.badgeDelegate infobarWasAccepted];
   [self dismissInfobarModal:self animated:YES completion:nil];
 }