OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_wk_navigation_states.h" | 5 #import "ios/web/web_state/ui/crw_wk_navigation_states.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 | 8 |
9 #if !defined(__has_feature) || !__has_feature(objc_arc) | 9 #if !defined(__has_feature) || !__has_feature(objc_arc) |
10 #error "This file requires ARC support." | 10 #error "This file requires ARC support." |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
98 for (WKNavigation* navigation in _records) { | 98 for (WKNavigation* navigation in _records) { |
99 CRWWKNavigationsStateRecord* record = [_records objectForKey:navigation]; | 99 CRWWKNavigationsStateRecord* record = [_records objectForKey:navigation]; |
100 if (lastAddedIndex < record.index) { | 100 if (lastAddedIndex < record.index) { |
101 result = navigation; | 101 result = navigation; |
102 lastAddedIndex = record.index; | 102 lastAddedIndex = record.index; |
103 } | 103 } |
104 } | 104 } |
105 return result; | 105 return result; |
106 } | 106 } |
107 | 107 |
| 108 - (web::WKNavigationState)lastAddedNavigationState { |
| 109 CRWWKNavigationsStateRecord* lastAddedRecord = nil; |
| 110 WKNavigation* lastAddedNavigation = [self lastAddedNavigation]; |
| 111 if (lastAddedNavigation) |
| 112 lastAddedRecord = [_records objectForKey:lastAddedNavigation]; |
| 113 |
| 114 return lastAddedRecord.state; |
| 115 } |
| 116 |
108 @end | 117 @end |
OLD | NEW |