blob: b1e26a7e9fbe8565de99752904247307c09f5d44 [file] [log] [blame]
// Copyright 2021 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#import "ios/chrome/browser/ui/start_surface/start_surface_recent_tab_removal_observer_bridge.h"
#if !defined(__has_feature) || !__has_feature(objc_arc)
#error "This file requires ARC support."
#endif
StartSurfaceRecentTabObserverBridge::StartSurfaceRecentTabObserverBridge(
id<StartSurfaceRecentTabObserving> delegate)
: delegate_(delegate) {}
StartSurfaceRecentTabObserverBridge::~StartSurfaceRecentTabObserverBridge() =
default;
void StartSurfaceRecentTabObserverBridge::MostRecentTabRemoved(
web::WebState* web_state) {
const SEL selector = @selector(mostRecentTabWasRemoved:);
if (![delegate_ respondsToSelector:selector])
return;
[delegate_ mostRecentTabWasRemoved:web_state];
}
void StartSurfaceRecentTabObserverBridge::MostRecentTabFaviconUpdated(
UIImage* image) {
const SEL selector = @selector(mostRecentTabFaviconUpdatedWithImage:);
if (![delegate_ respondsToSelector:selector])
return;
[delegate_ mostRecentTabFaviconUpdatedWithImage:image];
}