| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2012 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_model.h" | 5 #import "ios/chrome/browser/tabs/tab_model.h" |
| 6 | 6 |
| 7 #include <cstdint> | 7 #include <cstdint> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 114 base::Bind(&web::CertificatePolicyCache::ClearCertificatePolicies, | 114 base::Bind(&web::CertificatePolicyCache::ClearCertificatePolicies, |
| 115 policy_cache), | 115 policy_cache), |
| 116 base::Bind(&RestoreCertificatePolicyCacheFromModel, policy_cache, | 116 base::Bind(&RestoreCertificatePolicyCacheFromModel, policy_cache, |
| 117 base::Unretained(web_state_list))); | 117 base::Unretained(web_state_list))); |
| 118 } | 118 } |
| 119 | 119 |
| 120 // Internal helper function returning the opener for a given Tab by | 120 // Internal helper function returning the opener for a given Tab by |
| 121 // checking the associated Tab tabId (should be removed once the opener | 121 // checking the associated Tab tabId (should be removed once the opener |
| 122 // is passed to the insertTab:atIndex: and replaceTab:withTab: methods). | 122 // is passed to the insertTab:atIndex: and replaceTab:withTab: methods). |
| 123 Tab* GetOpenerForTab(id<NSFastEnumeration> tabs, Tab* tab) { | 123 Tab* GetOpenerForTab(id<NSFastEnumeration> tabs, Tab* tab) { |
| 124 NSString* opener_id = | 124 if (!tab.openerID) |
| 125 [tab navigationManager]->GetSessionController().openerId; | |
| 126 if (!opener_id) | |
| 127 return nullptr; | 125 return nullptr; |
| 128 | 126 |
| 129 for (Tab* currentTab in tabs) { | 127 for (Tab* currentTab in tabs) { |
| 130 if ([opener_id isEqualToString:currentTab.tabId]) | 128 if ([tab.openerID isEqualToString:currentTab.tabId]) |
| 131 return currentTab; | 129 return currentTab; |
| 132 } | 130 } |
| 133 | 131 |
| 134 return nullptr; | 132 return nullptr; |
| 135 } | 133 } |
| 136 | 134 |
| 137 } // anonymous namespace | 135 } // anonymous namespace |
| 138 | 136 |
| 139 @interface TabModelWebStateProxyFactory : NSObject<WebStateProxyFactory> | 137 @interface TabModelWebStateProxyFactory : NSObject<WebStateProxyFactory> |
| 140 @end | 138 @end |
| (...skipping 996 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1137 web::NavigationManager::WebLoadParams params(URL); | 1135 web::NavigationManager::WebLoadParams params(URL); |
| 1138 params.referrer = referrer; | 1136 params.referrer = referrer; |
| 1139 params.transition_type = ui::PAGE_TRANSITION_TYPED; | 1137 params.transition_type = ui::PAGE_TRANSITION_TYPED; |
| 1140 [[tab webController] loadWithParams:params]; | 1138 [[tab webController] loadWithParams:params]; |
| 1141 [tab webController].webUsageEnabled = webUsageEnabled_; | 1139 [tab webController].webUsageEnabled = webUsageEnabled_; |
| 1142 [self insertTab:tab atIndex:index opener:parentTab]; | 1140 [self insertTab:tab atIndex:index opener:parentTab]; |
| 1143 return tab; | 1141 return tab; |
| 1144 } | 1142 } |
| 1145 | 1143 |
| 1146 @end | 1144 @end |
| OLD | NEW |