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

Unified Diff: ios/web/web_state/ui/crw_wk_navigation_states.mm

Issue 2883423003: Added -[CRWWKNavigationStates pendingNavigations] API. (Closed)
Patch Set: Self review Created 3 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: ios/web/web_state/ui/crw_wk_navigation_states.mm
diff --git a/ios/web/web_state/ui/crw_wk_navigation_states.mm b/ios/web/web_state/ui/crw_wk_navigation_states.mm
index 77aa9d16a51ff2d601fb1418f1ef95be106f30b2..0ba34203200985ba2c62677ab997f0e57deb5fb1 100644
--- a/ios/web/web_state/ui/crw_wk_navigation_states.mm
+++ b/ios/web/web_state/ui/crw_wk_navigation_states.mm
@@ -170,6 +170,19 @@
return result.state;
}
+- (NSSet*)pendingNavigations {
+ NSMutableSet* result = [NSMutableSet set];
+ for (id navigation in _records) {
+ CRWWKNavigationsStateRecord* record = [_records objectForKey:navigation];
+ if (record.state == web::WKNavigationState::REQUESTED ||
+ record.state == web::WKNavigationState::STARTED ||
+ record.state == web::WKNavigationState::REDIRECTED) {
+ [result addObject:navigation];
+ }
+ }
+ return [result copy];
+}
+
- (id)keyForNavigation:(WKNavigation*)navigation {
return navigation ? navigation : _nullNavigation;
}
« 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