Index: ios/chrome/browser/tabs/tab.mm |
diff --git a/ios/chrome/browser/tabs/tab.mm b/ios/chrome/browser/tabs/tab.mm |
index f07a8a1f78f62fab739fa8b413f5b13e08fa584d..fb9cba3e0c170942859055533539373182fafad8 100644 |
--- a/ios/chrome/browser/tabs/tab.mm |
+++ b/ios/chrome/browser/tabs/tab.mm |
@@ -101,7 +101,6 @@ |
#import "ios/chrome/browser/ui/prerender_delegate.h" |
#import "ios/chrome/browser/ui/reader_mode/reader_mode_checker.h" |
#import "ios/chrome/browser/ui/reader_mode/reader_mode_controller.h" |
-#import "ios/chrome/browser/ui/sad_tab/sad_tab_view.h" |
#include "ios/chrome/browser/ui/ui_util.h" |
#import "ios/chrome/browser/web/auto_reload_bridge.h" |
#import "ios/chrome/browser/web/external_app_launcher.h" |
@@ -1945,19 +1944,6 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
if (visible_) { |
if (!applicationIsNotActive) { |
- base::WeakNSObject<Tab> weakSelf(self); |
- base::scoped_nsobject<SadTabView> sadTabView( |
- [[SadTabView alloc] initWithReloadHandler:^{ |
- base::scoped_nsobject<Tab> strongSelf([weakSelf retain]); |
- |
- // |check_for_repost| is true because this is called from SadTab and |
- // explicitly initiated by the user. |
- [strongSelf navigationManager]->Reload(web::ReloadType::NORMAL, |
- true /* check_for_repost */); |
- }]); |
- base::scoped_nsobject<CRWContentView> contentView( |
- [[CRWGenericContentView alloc] initWithView:sadTabView]); |
- self.webState->ShowTransientContentView(contentView); |
[fullScreenController_ disableFullScreen]; |
} |
} else { |
@@ -2088,6 +2074,13 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
[inputAccessoryViewController_ wasHidden]; |
} |
+#pragma mark - SadTabTabHelperDelegate |
+ |
+- (BOOL)isTabVisibleForTabHelper:(SadTabTabHelper*)tabHelper { |
+ UIApplicationState state = UIApplication.sharedApplication.applicationState; |
+ return visible_ && !IsApplicationStateNotActive(state); |
+} |
+ |
@end |
#pragma mark - TestingSupport |