Chromium Code Reviews| 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/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 2034 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2045 self.navigationManagerImpl->GetTransientItem(); | 2045 self.navigationManagerImpl->GetTransientItem(); |
| 2046 if (transientItem) { | 2046 if (transientItem) { |
| 2047 // If there's a transient item, a reload is considered a new navigation to | 2047 // If there's a transient item, a reload is considered a new navigation to |
| 2048 // the transient item's URL (as on other platforms). | 2048 // the transient item's URL (as on other platforms). |
| 2049 NavigationManager::WebLoadParams reloadParams(transientItem->GetURL()); | 2049 NavigationManager::WebLoadParams reloadParams(transientItem->GetURL()); |
| 2050 reloadParams.transition_type = ui::PAGE_TRANSITION_RELOAD; | 2050 reloadParams.transition_type = ui::PAGE_TRANSITION_RELOAD; |
| 2051 reloadParams.extra_headers.reset( | 2051 reloadParams.extra_headers.reset( |
| 2052 [transientItem->GetHttpRequestHeaders() copy]); | 2052 [transientItem->GetHttpRequestHeaders() copy]); |
| 2053 [self loadWithParams:reloadParams]; | 2053 [self loadWithParams:reloadParams]; |
| 2054 } else { | 2054 } else { |
| 2055 // As with back and forward navigation, load the URL manually instead of | 2055 self.currentNavItem->SetTransitionType( |
| 2056 // using the web view's reload. This ensures state processing and delegate | 2056 ui::PageTransition::PAGE_TRANSITION_RELOAD); |
|
Eugene But (OOO till 7-30)
2017/05/25 17:10:08
This is not true for WKWebView. |loadCurrentURL| w
|
kkhorimoto
2017/05/26 17:32:42
Is this what's done in content// as well? It seem
Eugene But (OOO till 7-30)
2017/05/26 17:48:32
I'm pretty sure they reset navigation to reload wh
|
| 2057 // calls are consistent. | |
| 2058 // TODO(eugenebut): revisit this for WKWebView. | |
| 2059 [self loadCurrentURL]; | 2057 [self loadCurrentURL]; |
| 2060 } | 2058 } |
| 2061 } | 2059 } |
| 2062 } | 2060 } |
| 2063 | 2061 |
| 2064 - (void)reload { | 2062 - (void)reload { |
| 2065 [_delegate webWillReload]; | 2063 [_delegate webWillReload]; |
| 2066 [self reloadInternal]; | 2064 [self reloadInternal]; |
| 2067 } | 2065 } |
| 2068 | 2066 |
| (...skipping 3172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5241 - (NSUInteger)observerCount { | 5239 - (NSUInteger)observerCount { |
| 5242 DCHECK_EQ(_observerBridges.size(), [_observers count]); | 5240 DCHECK_EQ(_observerBridges.size(), [_observers count]); |
| 5243 return [_observers count]; | 5241 return [_observers count]; |
| 5244 } | 5242 } |
| 5245 | 5243 |
| 5246 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5244 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5247 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5245 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5248 } | 5246 } |
| 5249 | 5247 |
| 5250 @end | 5248 @end |
| OLD | NEW |