[go: nahoru, domu]

blob: cbe5960501a9e5d0006393635c35543df2a451a2 [file] [log] [blame]
// Copyright 2021 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/signin/chrome_account_manager_service_observer_bridge.h"
#import "base/apple/foundation_util.h"
#import "ios/chrome/browser/signin/chrome_account_manager_service.h"
ChromeAccountManagerServiceObserverBridge::
ChromeAccountManagerServiceObserverBridge(
id<ChromeAccountManagerServiceObserver> observer,
ChromeAccountManagerService* account_manager_service)
: observer_(observer) {
DCHECK(observer_);
scoped_observation_.Observe(account_manager_service);
}
ChromeAccountManagerServiceObserverBridge::
~ChromeAccountManagerServiceObserverBridge() {}
void ChromeAccountManagerServiceObserverBridge::OnIdentityListChanged(
bool need_user_approval) {
if ([observer_ respondsToSelector:@selector(identityListChanged)]) {
[observer_ identityListChanged];
}
}
void ChromeAccountManagerServiceObserverBridge::OnIdentityUpdated(
id<SystemIdentity> identity) {
if ([observer_ respondsToSelector:@selector(identityUpdated:)]) {
[observer_ identityUpdated:identity];
}
}