Commit db32ed3b authored by Javier Ernesto Flores Robles's avatar Javier Ernesto Flores Robles Committed by Commit Bot

[iOS][Password-Breach] Reload table view on sign out

Update the table view in case the user is kicked out. Or logs out in
multi-window.

Bug: 986322
Change-Id: I45f1979bf27dfde6568fcaa525ab7443161342c0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1856078
Commit-Queue: Javier Ernesto Flores Robles <javierrobles@chromium.org>
Reviewed-by: default avatarGauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#705077}
parent 0b9c06d8
......@@ -32,6 +32,7 @@
#import "ios/chrome/browser/passwords/save_passwords_consumer.h"
#import "ios/chrome/browser/signin/authentication_service.h"
#include "ios/chrome/browser/signin/authentication_service_factory.h"
#import "ios/chrome/browser/signin/chrome_identity_service_observer_bridge.h"
#include "ios/chrome/browser/system_flags.h"
#import "ios/chrome/browser/ui/settings/cells/settings_cells_constants.h"
#import "ios/chrome/browser/ui/settings/cells/settings_switch_cell.h"
......@@ -155,6 +156,7 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
@interface PasswordsTableViewController () <
BooleanObserver,
ChromeIdentityServiceObserver,
PasswordDetailsTableViewControllerDelegate,
PasswordExporterDelegate,
PasswordExportActivityViewControllerDelegate,
......@@ -192,6 +194,8 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
password_manager::DuplicatesMap blacklistedPasswordDuplicates_;
// The current Chrome browser state.
ios::ChromeBrowserState* browserState_;
// Authentication Service Observer.
std::unique_ptr<ChromeIdentityServiceObserverBridge> identityServiceObserver_;
// Object storing the time of the previous successful re-authentication.
// This is meant to be used by the |ReauthenticationModule| for keeping
// re-authentications valid for a certain time interval within the scope
......@@ -260,6 +264,8 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
prefName:password_manager::prefs::
kPasswordLeakDetectionEnabled];
[passwordLeakCheckEnabled_ setObserver:self];
identityServiceObserver_.reset(
new ChromeIdentityServiceObserverBridge(self));
}
[self getLoginsFromPasswordStore];
[self updateUIForEditState];
......@@ -1314,4 +1320,14 @@ std::vector<std::unique_ptr<autofill::PasswordForm>> CopyOf(
return _passwordExporter;
}
#pragma mark - ChromeIdentityServiceObserver
- (void)identityListChanged {
[self reloadData];
}
- (void)chromeIdentityServiceWillBeDestroyed {
identityServiceObserver_.reset();
}
@end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment