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

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

Issue 2787593002: [ios] Clean up uses of private web API. (Closed)
Patch Set: Address comments (add TODO). 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_model.h ('k') | ios/chrome/browser/tabs/tab_model_unittest.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/chrome/browser/tabs/tab_model.mm
diff --git a/ios/chrome/browser/tabs/tab_model.mm b/ios/chrome/browser/tabs/tab_model.mm
index ad16e4171da1fc06afee6e0de556a2e8457e4854..a702cb34a4630fb4bdbd6087c933e8761965e040 100644
--- a/ios/chrome/browser/tabs/tab_model.mm
+++ b/ios/chrome/browser/tabs/tab_model.mm
@@ -470,16 +470,18 @@ void CleanCertificatePolicyCache(
Tab* tab = LegacyTabHelper::GetTabForWebState(webStatePtr);
DCHECK(tab);
- [tab webController].webUsageEnabled = webUsageEnabled_;
+ webStatePtr->SetWebUsageEnabled(webUsageEnabled_ ? true : false);
if (!inBackground && _tabUsageRecorder)
_tabUsageRecorder->TabCreatedForSelection(tab);
- [[tab webController] loadWithParams:loadParams];
+ webStatePtr->GetNavigationManager()->LoadURLWithParams(loadParams);
// Force the page to start loading even if it's in the background.
+ // TODO(crbug.com/705819): Remove this call.
if (webUsageEnabled_)
- [[tab webController] triggerPendingLoad];
+ webStatePtr->GetView();
+
NSDictionary* userInfo = @{
kTabModelTabKey : tab,
kTabModelOpenInBackgroundKey : @(inBackground),
@@ -560,8 +562,9 @@ void CleanCertificatePolicyCache(
if (webUsageEnabled_ == webUsageEnabled)
return;
webUsageEnabled_ = webUsageEnabled;
- for (Tab* tab in self) {
- tab.webUsageEnabled = webUsageEnabled;
+ for (int index = 0; index < _webStateList->count(); ++index) {
+ web::WebState* webState = _webStateList->GetWebStateAt(index);
+ webState->SetWebUsageEnabled(webUsageEnabled_ ? true : false);
}
}
@@ -714,7 +717,7 @@ void CleanCertificatePolicyCache(
web::WebState* webState = _webStateList->GetWebStateAt(index);
Tab* tab = LegacyTabHelper::GetTabForWebState(webState);
- tab.webController.webUsageEnabled = webUsageEnabled_;
+ webState->SetWebUsageEnabled(webUsageEnabled_ ? true : false);
tab.webController.usePlaceholderOverlay = YES;
// Restore the CertificatePolicyCache (note that webState is invalid after
« no previous file with comments | « ios/chrome/browser/tabs/tab_model.h ('k') | ios/chrome/browser/tabs/tab_model_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698