Chromium Code Reviews| 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..8835dc67d4d750eca62c0ed9fd90d3aed33620a9 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,16 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar, |
| [inputAccessoryViewController_ wasHidden]; |
| } |
| +#pragma mark - SadTabTabHelperDelegate |
| + |
| +- (BOOL)isTabVisibleForTabHelper:(SadTabTabHelper*)tabHelper { |
| + BOOL shouldBeActive = YES; |
|
Eugene But (OOO till 7-30)
2017/04/11 15:17:00
How about this?:
UIApplicationState state = UIApp
kkhorimoto
2017/04/11 17:38:02
+1, or at least rename |shouldBeActive| to |isTabV
peterlaurens
2017/04/11 21:57:26
Done, thanks!
To explain why I wrote this like t
|
| + UIApplicationState state = UIApplication.sharedApplication.applicationState; |
| + bool applicationIsActive = !IsApplicationStateNotActive(state); |
| + shouldBeActive = (visible_ && applicationIsActive); |
| + return shouldBeActive; |
| +} |
| + |
| @end |
| #pragma mark - TestingSupport |