Index: ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm |
diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm |
index 112f0fdfde42b5daf50ebae3dc2e6d8a9b6ac271..66a232db38195c2e74180ce23f35d771b362b1c2 100644 |
--- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm |
+++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm |
@@ -262,19 +262,19 @@ void FillVectorWithHashesUsingDistantSession( |
const NSInteger tabIndex = |
[[_panelView collectionView] indexPathForCell:cell].item; |
- if (_sessionType == TabSwitcherSessionType::DISTANT_SESSION) { |
- synced_sessions::DistantTab* tab = _distantSession->tabs[tabIndex].get(); |
- if (tab) |
- [self.delegate tabSwitcherPanelController:self didSelectDistantTab:tab]; |
- } else { |
+ if (TabSwitcherSessionTypeIsLocalSession(_sessionType)) { |
Tab* tab = _localSession->tabs()[tabIndex]; |
if (tab) |
[self.delegate tabSwitcherPanelController:self didSelectLocalTab:tab]; |
+ } else { |
+ synced_sessions::DistantTab* tab = _distantSession->tabs[tabIndex].get(); |
+ if (tab) |
+ [self.delegate tabSwitcherPanelController:self didSelectDistantTab:tab]; |
} |
} |
- (void)deleteButtonPressedForCell:(UICollectionViewCell*)cell { |
- DCHECK(_sessionType != TabSwitcherSessionType::DISTANT_SESSION); |
+ DCHECK(TabSwitcherSessionTypeIsLocalSession(_sessionType)); |
const NSInteger tabIndex = |
[[_panelView collectionView] indexPathForCell:cell].item; |
Tab* tab = _localSession->tabs()[tabIndex]; |