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

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

Issue 2775623002: [ios] WebStateList owns all WebState it manages. (Closed)
Patch Set: Remove Tab -willClose method (Tab implements CRWWebControllerObserver protocol). Created 3 years, 9 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
Index: ios/chrome/browser/tabs/tab_helper_util.mm
diff --git a/ios/chrome/browser/tabs/tab_helper_util.mm b/ios/chrome/browser/tabs/tab_helper_util.mm
index e277601ebf32c8093f82f5632280b2ec6a4511e6..84714be5133aaccd144a2874942507f12a8c5a6d 100644
--- a/ios/chrome/browser/tabs/tab_helper_util.mm
+++ b/ios/chrome/browser/tabs/tab_helper_util.mm
@@ -29,6 +29,7 @@
#import "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.h"
+#import "ios/chrome/browser/tabs/tab_private.h"
#import "ios/chrome/browser/translate/chrome_ios_translate_client.h"
#import "ios/chrome/browser/web/blocked_popup_tab_helper.h"
#import "ios/chrome/browser/web/network_activity_indicator_tab_helper.h"
@@ -37,7 +38,9 @@
#import "ios/web/public/web_state/web_state.h"
void AttachTabHelpers(web::WebState* web_state) {
+ LegacyTabHelper::CreateForWebState(web_state);
Tab* tab = LegacyTabHelper::GetTabForWebState(web_state);
+ DCHECK(tab);
ios::ChromeBrowserState* browser_state =
ios::ChromeBrowserState::FromBrowserState(web_state->GetBrowserState());
@@ -81,4 +84,8 @@ void AttachTabHelpers(web::WebState* web_state) {
// Allow the embedder to attach tab helpers.
ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state, tab);
+
+ // Allow the Tab to attach tab helper like objects (all those objects should
+ // really be tab helpers and created above).
+ [tab attachTabHelpers];
}

Powered by Google App Engine
This is Rietveld 408576698