Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(75)

Unified Diff: ios/chrome/browser/tabs/tab.mm

Issue 2807843002: Refactor creation of SadTabView into a tab helper object (Closed)
Patch Set: Attempt to fix build dependency Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab.h ('k') | ios/chrome/browser/tabs/tab_helper_util.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « ios/chrome/browser/tabs/tab.h ('k') | ios/chrome/browser/tabs/tab_helper_util.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698