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

Unified Diff: ios/chrome/browser/ui/tab_switcher/tab_switcher_panel_controller.mm

Issue 2612773002: [ios] Style cleanups in tab switcher code.
Patch Set: Created 3 years, 11 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/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];
« no previous file with comments | « ios/chrome/browser/ui/tab_switcher/tab_switcher_model.mm ('k') | ios/chrome/browser/ui/tab_switcher/tab_switcher_utils.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698