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

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

Issue 2681843002: Add mechanism to get the Tab from the associated WebState. (Closed)
Patch Set: Address comments. Created 3 years, 10 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/legacy_tab_helper.mm ('k') | no next file » | 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 3bc61e190e232071a9cff83b1efe4d836c09242c..18cfa16a2d057a84c6c9a5573fadf0d94c1fe6d1 100644
--- a/ios/chrome/browser/tabs/tab.mm
+++ b/ios/chrome/browser/tabs/tab.mm
@@ -88,6 +88,7 @@
#include "ios/chrome/browser/ssl/ios_security_state_tab_helper.h"
#import "ios/chrome/browser/storekit_launcher.h"
#include "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h"
+#import "ios/chrome/browser/tabs/legacy_tab_helper.h"
#import "ios/chrome/browser/tabs/tab_delegate.h"
#import "ios/chrome/browser/tabs/tab_dialog_delegate.h"
#import "ios/chrome/browser/tabs/tab_headers_delegate.h"
@@ -535,6 +536,10 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
webStateObserver_.reset(
new web::WebStateObserverBridge(webStateImpl_.get(), self));
+ // Do not respect |attachTabHelpers| as this tab helper is required for
+ // proper conversion from WebState to Tab.
+ LegacyTabHelper::CreateForWebState(webStateImpl_.get(), self);
+
[self.webController setDelegate:self];
NSString* sessionID = self.tabId;
@@ -1248,6 +1253,8 @@ void TabInfoBarObserver::OnInfoBarReplaced(infobars::InfoBar* old_infobar,
// to drive its own destruction.
base::scoped_nsobject<Tab> kungFuDeathGrip([self retain]);
[parentTabModel_ didCloseTab:self]; // Inform parent of tab closure.
+
+ LegacyTabHelper::RemoveFromWebState(webStateImpl_.get());
webStateImpl_.reset();
}
« no previous file with comments | « ios/chrome/browser/tabs/legacy_tab_helper.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698