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

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

Issue 2685803002: Fixed title updating for back forward navigation. (Closed)
Patch Set: Stubbed title call Created 3 years, 10 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 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
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
OLDNEW
« no previous file with comments | « ios/web/web_state/ui/crw_wk_navigation_states.h ('k') | ios/web/web_state/ui/crw_wk_navigation_states_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698