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

Side by Side Diff: ios/chrome/browser/tabs/tab_helper_util.mm

Issue 2956483003: [ios] TabIdTabHelper (Closed)
Patch Set: Additional unit tests and other edits. Created 3 years, 5 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 unified diff | Download patch
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "ios/chrome/browser/tabs/tab_helper_util.h" 5 #import "ios/chrome/browser/tabs/tab_helper_util.h"
6 6
7 #if !defined(__has_feature) || !__has_feature(objc_arc) 7 #if !defined(__has_feature) || !__has_feature(objc_arc)
8 #error "This file requires ARC support." 8 #error "This file requires ARC support."
9 #endif 9 #endif
10 10
(...skipping 17 matching lines...) Expand all
28 #import "ios/chrome/browser/store_kit/store_kit_tab_helper.h" 28 #import "ios/chrome/browser/store_kit/store_kit_tab_helper.h"
29 #import "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h" 29 #import "ios/chrome/browser/sync/ios_chrome_synced_tab_delegate.h"
30 #import "ios/chrome/browser/tabs/legacy_tab_helper.h" 30 #import "ios/chrome/browser/tabs/legacy_tab_helper.h"
31 #import "ios/chrome/browser/tabs/tab.h" 31 #import "ios/chrome/browser/tabs/tab.h"
32 #import "ios/chrome/browser/tabs/tab_private.h" 32 #import "ios/chrome/browser/tabs/tab_private.h"
33 #import "ios/chrome/browser/translate/chrome_ios_translate_client.h" 33 #import "ios/chrome/browser/translate/chrome_ios_translate_client.h"
34 #import "ios/chrome/browser/web/blocked_popup_tab_helper.h" 34 #import "ios/chrome/browser/web/blocked_popup_tab_helper.h"
35 #import "ios/chrome/browser/web/network_activity_indicator_tab_helper.h" 35 #import "ios/chrome/browser/web/network_activity_indicator_tab_helper.h"
36 #import "ios/chrome/browser/web/repost_form_tab_helper.h" 36 #import "ios/chrome/browser/web/repost_form_tab_helper.h"
37 #import "ios/chrome/browser/web/sad_tab_tab_helper.h" 37 #import "ios/chrome/browser/web/sad_tab_tab_helper.h"
38 #import "ios/chrome/browser/web/tab_id_tab_helper.h"
38 #import "ios/public/provider/chrome/browser/chrome_browser_provider.h" 39 #import "ios/public/provider/chrome/browser/chrome_browser_provider.h"
39 #import "ios/web/public/web_state/web_state.h" 40 #import "ios/web/public/web_state/web_state.h"
40 41
41 void AttachTabHelpers(web::WebState* web_state) { 42 void AttachTabHelpers(web::WebState* web_state) {
43 // TabIdHelper sets up the tab ID which is required for the creation of the
44 // Tab by LegacyTabHelper.
45 TabIdTabHelper::CreateForWebState(web_state);
42 LegacyTabHelper::CreateForWebState(web_state); 46 LegacyTabHelper::CreateForWebState(web_state);
43 Tab* tab = LegacyTabHelper::GetTabForWebState(web_state); 47 Tab* tab = LegacyTabHelper::GetTabForWebState(web_state);
44 DCHECK(tab); 48 DCHECK(tab);
45 49
46 ios::ChromeBrowserState* browser_state = 50 ios::ChromeBrowserState* browser_state =
47 ios::ChromeBrowserState::FromBrowserState(web_state->GetBrowserState()); 51 ios::ChromeBrowserState::FromBrowserState(web_state->GetBrowserState());
48 52
49 // IOSChromeSessionTabHelper comes first because it sets up the tab ID, 53 // IOSChromeSessionTabHelper sets up the session ID used by other helpers,
50 // and other helpers may rely on that. 54 // so it needs to be created before them.
51 IOSChromeSessionTabHelper::CreateForWebState(web_state); 55 IOSChromeSessionTabHelper::CreateForWebState(web_state);
52 56
53 NetworkActivityIndicatorTabHelper::CreateForWebState(web_state, tab.tabId); 57 NetworkActivityIndicatorTabHelper::CreateForWebState(web_state, tab.tabId);
54 IOSChromeSyncedTabDelegate::CreateForWebState(web_state); 58 IOSChromeSyncedTabDelegate::CreateForWebState(web_state);
55 InfoBarManagerImpl::CreateForWebState(web_state); 59 InfoBarManagerImpl::CreateForWebState(web_state);
56 IOSSecurityStateTabHelper::CreateForWebState(web_state); 60 IOSSecurityStateTabHelper::CreateForWebState(web_state);
57 RepostFormTabHelper::CreateForWebState(web_state); 61 RepostFormTabHelper::CreateForWebState(web_state);
58 BlockedPopupTabHelper::CreateForWebState(web_state); 62 BlockedPopupTabHelper::CreateForWebState(web_state);
59 FindTabHelper::CreateForWebState(web_state, tab.findInPageControllerDelegate); 63 FindTabHelper::CreateForWebState(web_state, tab.findInPageControllerDelegate);
60 StoreKitTabHelper::CreateForWebState(web_state); 64 StoreKitTabHelper::CreateForWebState(web_state);
(...skipping 23 matching lines...) Expand all
84 web_state, 88 web_state,
85 ios::TopSitesFactory::GetForBrowserState(original_browser_state).get()); 89 ios::TopSitesFactory::GetForBrowserState(original_browser_state).get());
86 90
87 // Allow the embedder to attach tab helpers. 91 // Allow the embedder to attach tab helpers.
88 ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state, tab); 92 ios::GetChromeBrowserProvider()->AttachTabHelpers(web_state, tab);
89 93
90 // Allow the Tab to attach tab helper like objects (all those objects should 94 // Allow the Tab to attach tab helper like objects (all those objects should
91 // really be tab helpers and created above). 95 // really be tab helpers and created above).
92 [tab attachTabHelpers]; 96 [tab attachTabHelpers];
93 } 97 }
OLDNEW
« no previous file with comments | « ios/chrome/browser/tabs/tab.mm ('k') | ios/chrome/browser/tabs/tab_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698