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

Unified Diff: ios/chrome/browser/ui/browser_view_controller.mm

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: tentative change 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/ui/browser_view_controller.mm
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm
index 32bc6f7e3a4089fbbfc9fabdf277b6dfc4630e54..134c9568c7d66c37043103657929f5067d22910e 100644
--- a/ios/chrome/browser/ui/browser_view_controller.mm
+++ b/ios/chrome/browser/ui/browser_view_controller.mm
@@ -2885,13 +2885,18 @@ - (void)overscrollActionsController:(OverscrollActionsController*)controller
case OverscrollAction::CLOSE_TAB:
[self closeCurrentTab];
break;
- case OverscrollAction::REFRESH:
+ case OverscrollAction::REFRESH: {
if ([[[_model currentTab] webController] loadPhase] ==
web::PAGE_LOADING) {
[[_model currentTab] stopLoading];
}
- [[_model currentTab] reload];
+
+ web::WebState* webState = [_model currentTab].webState;
+ if (webState)
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ true /* check_for_repost */);
break;
+ }
case OverscrollAction::NONE:
NOTREACHED();
break;
@@ -3842,9 +3847,11 @@ - (IBAction)locationBarDidResignFirstResponder:(id)sender {
// editing ends (i.e., editing was cancelled), restart the cancelled load.
if (_locationBarEditCancelledLoad) {
_locationBarEditCancelledLoad = NO;
- if (!_toolbarModelIOS->IsLoading()) {
- [[_model currentTab] reload];
- }
+
+ web::WebState* webState = [_model currentTab].webState;
+ if (!_toolbarModelIOS->IsLoading() && webState)
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ false /* check_for_repost */);
}
}
@@ -3986,9 +3993,13 @@ - (IBAction)chromeExecuteCommand:(id)sender {
[super chromeExecuteCommand:sender];
}
break;
- case IDC_RELOAD:
- [[_model currentTab] reload];
+ case IDC_RELOAD: {
+ web::WebState* webState = [_model currentTab].webState;
+ if (webState)
+ webState->GetNavigationManager()->Reload(web::ReloadType::NORMAL,
+ true /* check_for_repost */);
break;
+ }
case IDC_SHARE_PAGE:
[self sharePage];
break;

Powered by Google App Engine
This is Rietveld 408576698