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

Side by Side Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2741413007: Refactoring Reload in NavigationManager and CRWWebController. (Closed)
Patch Set: Addressed high level comments 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 unified diff | Download patch
OLDNEW
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/web/web_state/ui/crw_web_controller.h" 5 #import "ios/web/web_state/ui/crw_web_controller.h"
6 6
7 #import <WebKit/WebKit.h> 7 #import <WebKit/WebKit.h>
8 8
9 #import <objc/runtime.h> 9 #import <objc/runtime.h>
10 #include <stddef.h> 10 #include <stddef.h>
(...skipping 1826 matching lines...) Expand 10 before | Expand all | Expand 10 after
1837 item->SetVirtualURL([nativeContent virtualURL]); 1837 item->SetVirtualURL([nativeContent virtualURL]);
1838 } 1838 }
1839 1839
1840 [self registerLoadRequest:targetURL 1840 [self registerLoadRequest:targetURL
1841 referrer:referrer 1841 referrer:referrer
1842 transition:self.currentTransition]; 1842 transition:self.currentTransition];
1843 [self loadNativeViewWithSuccess:YES]; 1843 [self loadNativeViewWithSuccess:YES];
1844 } 1844 }
1845 1845
1846 - (void)loadWithParams:(const NavigationManager::WebLoadParams&)originalParams { 1846 - (void)loadWithParams:(const NavigationManager::WebLoadParams&)originalParams {
1847 if (PageTransitionCoreTypeIs(originalParams.transition_type,
1848 ui::PAGE_TRANSITION_RELOAD)) {
1849 [self reload];
1850 return;
1851 }
1852
1847 // Make a copy of |params|, as some of the delegate methods may modify it. 1853 // Make a copy of |params|, as some of the delegate methods may modify it.
1848 NavigationManager::WebLoadParams params(originalParams); 1854 NavigationManager::WebLoadParams params(originalParams);
1849 1855
1850 // Initiating a navigation from the UI, record the current page state before 1856 // Initiating a navigation from the UI, record the current page state before
1851 // the new page loads. Don't record for back/forward, as the current entry 1857 // the new page loads. Don't record for back/forward, as the current entry
1852 // has already been moved to the next entry in the history. Do, however, 1858 // has already been moved to the next entry in the history. Do, however,
1853 // record it for general reload. 1859 // record it for general reload.
1854 // TODO(jimblackler): consider a single unified call to record state whenever 1860 // TODO(jimblackler): consider a single unified call to record state whenever
1855 // the page is about to be changed. This cannot currently be done after 1861 // the page is about to be changed. This cannot currently be done after
1856 // addPendingItem is called. 1862 // addPendingItem is called.
(...skipping 3362 matching lines...) Expand 10 before | Expand all | Expand 10 after
5219 - (void)simulateLoadRequestWithURL:(const GURL&)URL { 5225 - (void)simulateLoadRequestWithURL:(const GURL&)URL {
5220 _lastRegisteredRequestURL = URL; 5226 _lastRegisteredRequestURL = URL;
5221 _loadPhase = web::LOAD_REQUESTED; 5227 _loadPhase = web::LOAD_REQUESTED;
5222 } 5228 }
5223 5229
5224 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { 5230 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action {
5225 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; 5231 return [action.request valueForHTTPHeaderField:kReferrerHeaderName];
5226 } 5232 }
5227 5233
5228 @end 5234 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698