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 1783 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1794 NavigationManager::WebLoadParams params(originalParams); | 1794 NavigationManager::WebLoadParams params(originalParams); |
| 1795 | 1795 |
| 1796 // Initiating a navigation from the UI, record the current page state before | 1796 // Initiating a navigation from the UI, record the current page state before |
| 1797 // the new page loads. | 1797 // the new page loads. |
| 1798 | 1798 |
| 1799 [_delegate webWillInitiateLoadWithParams:params]; | 1799 [_delegate webWillInitiateLoadWithParams:params]; |
| 1800 | 1800 |
| 1801 GURL navUrl = params.url; | 1801 GURL navUrl = params.url; |
| 1802 ui::PageTransition transition = params.transition_type; | 1802 ui::PageTransition transition = params.transition_type; |
| 1803 DCHECK(!(transition & ui::PAGE_TRANSITION_FORWARD_BACK)); | 1803 DCHECK(!(transition & ui::PAGE_TRANSITION_FORWARD_BACK)); |
| 1804 // This method is allowed to handle reload only for transient items, which | 1804 // This method is allowed to handle reload only for transient items, which |
|
Eugene But (OOO till 7-30)
2017/03/21 15:48:19
Could you please merge your comment into existing
Olivier
2017/03/21 16:41:31
Done.
| |
| 1805 // is essentially loading the same URL again. | 1805 // is essentially loading the same URL again. |
| 1806 DCHECK(!(transition & ui::PAGE_TRANSITION_RELOAD) || | 1806 // If the web controller was displaying a native content, the native content |
| 1807 // can trigger a reload. | |
| 1808 DCHECK(self.nativeController || !(transition & ui::PAGE_TRANSITION_RELOAD) || | |
| 1807 self.navigationManagerImpl->GetTransientItem()); | 1809 self.navigationManagerImpl->GetTransientItem()); |
| 1808 | 1810 |
| 1809 BOOL initialNavigation = NO; | 1811 BOOL initialNavigation = NO; |
| 1810 // Clear transient view before making any changes to history and navigation | 1812 // Clear transient view before making any changes to history and navigation |
| 1811 // manager. TODO(stuartmorgan): Drive Transient Item clearing from | 1813 // manager. TODO(stuartmorgan): Drive Transient Item clearing from |
| 1812 // navigation system, rather than from WebController. | 1814 // navigation system, rather than from WebController. |
| 1813 [self clearTransientContentView]; | 1815 [self clearTransientContentView]; |
| 1814 | 1816 |
| 1815 [self recordStateInHistory]; | 1817 [self recordStateInHistory]; |
| 1816 | 1818 |
| (...skipping 3258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5075 - (void)simulateLoadRequestWithURL:(const GURL&)URL { | 5077 - (void)simulateLoadRequestWithURL:(const GURL&)URL { |
| 5076 _lastRegisteredRequestURL = URL; | 5078 _lastRegisteredRequestURL = URL; |
| 5077 _loadPhase = web::LOAD_REQUESTED; | 5079 _loadPhase = web::LOAD_REQUESTED; |
| 5078 } | 5080 } |
| 5079 | 5081 |
| 5080 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { | 5082 - (NSString*)referrerFromNavigationAction:(WKNavigationAction*)action { |
| 5081 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; | 5083 return [action.request valueForHTTPHeaderField:kReferrerHeaderName]; |
| 5082 } | 5084 } |
| 5083 | 5085 |
| 5084 @end | 5086 @end |
| OLD | NEW |