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..5e17561ae5e7eb800c0eaf6fc5e19e7ee9d9a532 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]; |
} |
+- (BOOL)tabHelperShouldBeActive:(NSString*)tabHelperID { |
Eugene But (OOO till 7-30)
2017/04/10 22:56:28
nit: Do you want to pragma mark this?
PL
2017/04/11 01:35:21
Done, thanks!
|
+ BOOL shouldBeActive = YES; |
+ if (tabHelperID == SadTabTabHelperID) { |
+ UIApplicationState state = UIApplication.sharedApplication.applicationState; |
+ BOOL applicationIsActive = IsApplicationStateNotActive(state) == NO; |
Eugene But (OOO till 7-30)
2017/04/10 22:56:28
Comparing BOOL variable to NO may not always work
PL
2017/04/11 01:35:21
Done: Tweaked as discussed, thanks!
|
+ shouldBeActive = (visible_ && applicationIsActive); |
+ } |
+ return shouldBeActive; |
+} |
+ |
@end |
#pragma mark - TestingSupport |