Index: ios/chrome/browser/ui/browser_view_controller.mm |
diff --git a/ios/chrome/browser/ui/browser_view_controller.mm b/ios/chrome/browser/ui/browser_view_controller.mm |
index 4f586b25a365809c32a46dcda2b3a0da7f966b93..def98c5910ccf956f91682776318c9cd4f772a51 100644 |
--- a/ios/chrome/browser/ui/browser_view_controller.mm |
+++ b/ios/chrome/browser/ui/browser_view_controller.mm |
@@ -1095,12 +1095,19 @@ - (BOOL)canShowFindBar { |
web::WebState* webState = [_model currentTab].webState; |
if (!webState) |
return web::UserAgentType::NONE; |
- web::NavigationItem* visibleItem = |
- webState->GetNavigationManager()->GetVisibleItem(); |
- if (!visibleItem) |
+ |
+ // TODO(crbug.com/707081): Clean this up once the bug is fixed. |
Eugene But (OOO till 7-30)
2017/03/31 18:06:40
We should not land this code duplication, unless w
liaoyuke
2017/03/31 18:29:03
Makes sense! I'll just keep this piece of code as
|
+ web::NavigationItem* item = |
+ webState->GetNavigationManager()->GetTransientItem(); |
+ if (!item) |
+ item = webState->GetNavigationManager()->GetPendingItem(); |
+ if (!item) |
+ item = webState->GetNavigationManager()->GetLastCommittedItem(); |
+ |
+ if (!item) |
return web::UserAgentType::NONE; |
- return visibleItem->GetUserAgentType(); |
+ return item->GetUserAgentType(); |
} |
- (void)setVisible:(BOOL)visible { |