OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/chrome/browser/ui/tab_switcher/tab_switcher_controller.h" | 5 #import "ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.h" |
6 | 6 |
7 #include "base/ios/block_types.h" | 7 #include "base/ios/block_types.h" |
8 #include "base/ios/weak_nsobject.h" | 8 #include "base/ios/weak_nsobject.h" |
9 #include "base/mac/scoped_nsobject.h" | 9 #include "base/mac/scoped_nsobject.h" |
10 #include "base/metrics/user_metrics.h" | 10 #include "base/metrics/user_metrics.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // not be nil. | 129 // not be nil. |
130 - (void)performTabSwitcherTransition:(TransitionType)transitionType | 130 - (void)performTabSwitcherTransition:(TransitionType)transitionType |
131 withModel:(TabModel*)tabModel | 131 withModel:(TabModel*)tabModel |
132 animated:(BOOL)animated | 132 animated:(BOOL)animated |
133 withCompletion:(ProceduralBlock)completion; | 133 withCompletion:(ProceduralBlock)completion; |
134 | 134 |
135 // Returns the index of the currently selected panel. | 135 // Returns the index of the currently selected panel. |
136 - (NSInteger)currentPanelIndex; | 136 - (NSInteger)currentPanelIndex; |
137 | 137 |
138 // Returns the session type of the panel and the given index. | 138 // Returns the session type of the panel and the given index. |
139 - (ios_internal::SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex; | 139 - (TabSwitcherSessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex; |
140 | 140 |
141 // Returns the tab model corresponding to the given session type. | 141 // Returns the tab model corresponding to the given session type. |
142 // There is no tab model for distant sessions so it returns nil for distant | 142 // There is no tab model for distant sessions so it returns nil for distant |
143 // sessions type. | 143 // sessions type. |
144 - (TabModel*)tabModelForSessionType:(ios_internal::SessionType)sessionType; | 144 - (TabModel*)tabModelForSessionType:(TabSwitcherSessionType)sessionType; |
145 | 145 |
146 // Returns the tab model of the currently selected tab. | 146 // Returns the tab model of the currently selected tab. |
147 - (TabModel*)currentSelectedModel; | 147 - (TabModel*)currentSelectedModel; |
148 | 148 |
149 // Calls tabSwitcherDismissWithModel:animated: with the |animated| parameter | 149 // Calls tabSwitcherDismissWithModel:animated: with the |animated| parameter |
150 // set to YES. | 150 // set to YES. |
151 - (void)tabSwitcherDismissWithModel:(TabModel*)model; | 151 - (void)tabSwitcherDismissWithModel:(TabModel*)model; |
152 | 152 |
153 // Dismisses the tab switcher using the given tab model. The completion block is | 153 // Dismisses the tab switcher using the given tab model. The completion block is |
154 // called at the end of the animation. The tab switcher delegate method | 154 // called at the end of the animation. The tab switcher delegate method |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 _tabSwitcherModel.reset([[TabSwitcherModel alloc] | 200 _tabSwitcherModel.reset([[TabSwitcherModel alloc] |
201 initWithBrowserState:browserState | 201 initWithBrowserState:browserState |
202 delegate:self | 202 delegate:self |
203 mainTabModel:mainTabModel | 203 mainTabModel:mainTabModel |
204 otrTabModel:otrTabModel | 204 otrTabModel:otrTabModel |
205 withCache:_cache]); | 205 withCache:_cache]); |
206 _controllersOfDistantSessions.reset([[NSMutableArray alloc] init]); | 206 _controllersOfDistantSessions.reset([[NSMutableArray alloc] init]); |
207 [self loadTabSwitcherView]; | 207 [self loadTabSwitcherView]; |
208 _onTheRecordSession.reset([[TabSwitcherPanelController alloc] | 208 _onTheRecordSession.reset([[TabSwitcherPanelController alloc] |
209 initWithModel:_tabSwitcherModel | 209 initWithModel:_tabSwitcherModel |
210 forLocalSessionOfType:ios_internal::SessionType::REGULAR_SESSION | 210 forLocalSessionOfType:TabSwitcherSessionType::REGULAR_SESSION |
211 withCache:_cache | 211 withCache:_cache |
212 browserState:_browserState]); | 212 browserState:_browserState]); |
213 [_onTheRecordSession setDelegate:self]; | 213 [_onTheRecordSession setDelegate:self]; |
214 _offTheRecordSession.reset([[TabSwitcherPanelController alloc] | 214 _offTheRecordSession.reset([[TabSwitcherPanelController alloc] |
215 initWithModel:_tabSwitcherModel | 215 initWithModel:_tabSwitcherModel |
216 forLocalSessionOfType:ios_internal::SessionType::OFF_THE_RECORD_SESSION | 216 forLocalSessionOfType:TabSwitcherSessionType::OFF_THE_RECORD_SESSION |
217 withCache:_cache | 217 withCache:_cache |
218 browserState:_browserState]); | 218 browserState:_browserState]); |
219 [_offTheRecordSession setDelegate:self]; | 219 [_offTheRecordSession setDelegate:self]; |
220 [_tabSwitcherView addPanelView:[_offTheRecordSession view] | 220 [_tabSwitcherView addPanelView:[_offTheRecordSession view] |
221 atIndex:kLocalTabsOffTheRecordPanelIndex]; | 221 atIndex:kLocalTabsOffTheRecordPanelIndex]; |
222 [_tabSwitcherView addPanelView:[_onTheRecordSession view] | 222 [_tabSwitcherView addPanelView:[_onTheRecordSession view] |
223 atIndex:kLocalTabsOnTheRecordPanelIndex]; | 223 atIndex:kLocalTabsOnTheRecordPanelIndex]; |
224 [self addPromoPanelForSignInPanelType:[_tabSwitcherModel signInPanelType]]; | 224 [self addPromoPanelForSignInPanelType:[_tabSwitcherModel signInPanelType]]; |
225 [[_tabSwitcherView headerView] reloadData]; | 225 [[_tabSwitcherView headerView] reloadData]; |
226 [_tabSwitcherModel syncedSessionsChanged]; | 226 [_tabSwitcherModel syncedSessionsChanged]; |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 | 385 |
386 switch (command) { | 386 switch (command) { |
387 case IDC_NEW_INCOGNITO_TAB: // fallthrough | 387 case IDC_NEW_INCOGNITO_TAB: // fallthrough |
388 case IDC_NEW_TAB: { | 388 case IDC_NEW_TAB: { |
389 // Ensure that the right mode is showing. | 389 // Ensure that the right mode is showing. |
390 NSInteger panelIndex = (command == IDC_NEW_TAB) | 390 NSInteger panelIndex = (command == IDC_NEW_TAB) |
391 ? kLocalTabsOnTheRecordPanelIndex | 391 ? kLocalTabsOnTheRecordPanelIndex |
392 : kLocalTabsOffTheRecordPanelIndex; | 392 : kLocalTabsOffTheRecordPanelIndex; |
393 [_tabSwitcherView selectPanelAtIndex:panelIndex]; | 393 [_tabSwitcherView selectPanelAtIndex:panelIndex]; |
394 | 394 |
395 const ios_internal::SessionType panelSessionType = | 395 const TabSwitcherSessionType panelSessionType = |
396 (command == IDC_NEW_TAB) | 396 (command == IDC_NEW_TAB) |
397 ? ios_internal::SessionType::REGULAR_SESSION | 397 ? TabSwitcherSessionType::REGULAR_SESSION |
398 : ios_internal::SessionType::OFF_THE_RECORD_SESSION; | 398 : TabSwitcherSessionType::OFF_THE_RECORD_SESSION; |
399 | 399 |
400 TabModel* model = [self tabModelForSessionType:panelSessionType]; | 400 TabModel* model = [self tabModelForSessionType:panelSessionType]; |
401 [self dismissWithNewTabAnimation:GURL(kChromeUINewTabURL) | 401 [self dismissWithNewTabAnimation:GURL(kChromeUINewTabURL) |
402 atIndex:NSNotFound | 402 atIndex:NSNotFound |
403 transition:ui::PAGE_TRANSITION_TYPED | 403 transition:ui::PAGE_TRANSITION_TYPED |
404 tabModel:model]; | 404 tabModel:model]; |
405 } break; | 405 } break; |
406 case IDC_TOGGLE_TAB_SWITCHER: | 406 case IDC_TOGGLE_TAB_SWITCHER: |
407 [self tabSwitcherDismissWithCurrentSelectedModel]; | 407 [self tabSwitcherDismissWithCurrentSelectedModel]; |
408 break; | 408 break; |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
730 return [_tabSwitcherView currentPanelIndex]; | 730 return [_tabSwitcherView currentPanelIndex]; |
731 } | 731 } |
732 | 732 |
733 - (int)offsetToDistantSessionPanels { | 733 - (int)offsetToDistantSessionPanels { |
734 if (_signInPanelType == TabSwitcherSignInPanelsType::NO_PANEL) { | 734 if (_signInPanelType == TabSwitcherSignInPanelsType::NO_PANEL) { |
735 return kSignInPromoPanelIndex; | 735 return kSignInPromoPanelIndex; |
736 } | 736 } |
737 return kSignInPromoPanelIndex + 1; | 737 return kSignInPromoPanelIndex + 1; |
738 } | 738 } |
739 | 739 |
740 - (ios_internal::SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex { | 740 - (TabSwitcherSessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex { |
741 if (panelIndex == kLocalTabsOffTheRecordPanelIndex) | 741 if (panelIndex == kLocalTabsOffTheRecordPanelIndex) |
742 return ios_internal::SessionType::OFF_THE_RECORD_SESSION; | 742 return TabSwitcherSessionType::OFF_THE_RECORD_SESSION; |
743 if (panelIndex == kLocalTabsOnTheRecordPanelIndex) | 743 if (panelIndex == kLocalTabsOnTheRecordPanelIndex) |
744 return ios_internal::SessionType::REGULAR_SESSION; | 744 return TabSwitcherSessionType::REGULAR_SESSION; |
745 return ios_internal::SessionType::DISTANT_SESSION; | 745 return TabSwitcherSessionType::DISTANT_SESSION; |
746 } | 746 } |
747 | 747 |
748 - (TabModel*)tabModelForSessionType:(ios_internal::SessionType)sessionType { | 748 - (TabModel*)tabModelForSessionType:(TabSwitcherSessionType)sessionType { |
749 switch (sessionType) { | 749 switch (sessionType) { |
750 case ios_internal::SessionType::REGULAR_SESSION: | 750 case TabSwitcherSessionType::REGULAR_SESSION: |
751 return [_tabSwitcherModel mainTabModel]; | 751 return [_tabSwitcherModel mainTabModel]; |
752 break; | 752 break; |
753 case ios_internal::SessionType::OFF_THE_RECORD_SESSION: | 753 case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: |
754 return [_tabSwitcherModel otrTabModel]; | 754 return [_tabSwitcherModel otrTabModel]; |
755 break; | 755 break; |
756 case ios_internal::SessionType::DISTANT_SESSION: | 756 case TabSwitcherSessionType::DISTANT_SESSION: |
757 return nil; | 757 return nil; |
758 break; | 758 break; |
759 } | 759 } |
760 } | 760 } |
761 | 761 |
762 - (TabModel*)currentSelectedModel { | 762 - (TabModel*)currentSelectedModel { |
763 const NSInteger currentPanelIndex = [self currentPanelIndex]; | 763 const NSInteger currentPanelIndex = [self currentPanelIndex]; |
764 const ios_internal::SessionType sessionType = | 764 const TabSwitcherSessionType sessionType = |
765 [self sessionTypeForPanelIndex:currentPanelIndex]; | 765 [self sessionTypeForPanelIndex:currentPanelIndex]; |
766 TabModel* model = [self tabModelForSessionType:sessionType]; | 766 TabModel* model = [self tabModelForSessionType:sessionType]; |
767 if (!model) | 767 if (!model) |
768 model = _onLoadActiveModel; | 768 model = _onLoadActiveModel; |
769 return model; | 769 return model; |
770 } | 770 } |
771 | 771 |
772 - (void)selectPanelForTabModel:(TabModel*)selectedTabModel { | 772 - (void)selectPanelForTabModel:(TabModel*)selectedTabModel { |
773 DCHECK(selectedTabModel == [_tabSwitcherModel otrTabModel] || | 773 DCHECK(selectedTabModel == [_tabSwitcherModel otrTabModel] || |
774 selectedTabModel == [_tabSwitcherModel mainTabModel]); | 774 selectedTabModel == [_tabSwitcherModel mainTabModel]); |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
996 for (TabSwitcherPanelController* panel in _controllersOfDistantSessions | 996 for (TabSwitcherPanelController* panel in _controllersOfDistantSessions |
997 .get()) { | 997 .get()) { |
998 DCHECK([panel isKindOfClass:[TabSwitcherPanelController class]]); | 998 DCHECK([panel isKindOfClass:[TabSwitcherPanelController class]]); |
999 if ([panel sessionTag] == tag) { | 999 if ([panel sessionTag] == tag) { |
1000 [panel updateCollectionViewIfNeeded]; | 1000 [panel updateCollectionViewIfNeeded]; |
1001 return; | 1001 return; |
1002 } | 1002 } |
1003 } | 1003 } |
1004 } | 1004 } |
1005 | 1005 |
1006 - (void)localSessionMayNeedUpdate:(ios_internal::SessionType)type { | 1006 - (void)localSessionMayNeedUpdate:(TabSwitcherSessionType)type { |
1007 if (type == ios_internal::SessionType::REGULAR_SESSION) { | 1007 if (type == TabSwitcherSessionType::REGULAR_SESSION) { |
1008 [_onTheRecordSession updateCollectionViewIfNeeded]; | 1008 [_onTheRecordSession updateCollectionViewIfNeeded]; |
1009 } else { | 1009 } else { |
1010 DCHECK(type == ios_internal::SessionType::OFF_THE_RECORD_SESSION); | 1010 DCHECK(type == TabSwitcherSessionType::OFF_THE_RECORD_SESSION); |
1011 [_offTheRecordSession updateCollectionViewIfNeeded]; | 1011 [_offTheRecordSession updateCollectionViewIfNeeded]; |
1012 } | 1012 } |
1013 } | 1013 } |
1014 | 1014 |
1015 - (void)signInPanelChangedTo:(TabSwitcherSignInPanelsType)newPanelType { | 1015 - (void)signInPanelChangedTo:(TabSwitcherSignInPanelsType)newPanelType { |
1016 if (_signInPanelType == newPanelType) | 1016 if (_signInPanelType == newPanelType) |
1017 return; | 1017 return; |
1018 | 1018 |
1019 // Remove promo panel that is no longer relevant, if any. | 1019 // Remove promo panel that is no longer relevant, if any. |
1020 if (_signInPanelType != TabSwitcherSignInPanelsType::NO_PANEL) { | 1020 if (_signInPanelType != TabSwitcherSignInPanelsType::NO_PANEL) { |
(...skipping 14 matching lines...) Expand all Loading... |
1035 TabSwitcherPanelOverlayView* panelView = | 1035 TabSwitcherPanelOverlayView* panelView = |
1036 [[[TabSwitcherPanelOverlayView alloc] initWithFrame:CGRectZero | 1036 [[[TabSwitcherPanelOverlayView alloc] initWithFrame:CGRectZero |
1037 browserState:_browserState] | 1037 browserState:_browserState] |
1038 autorelease]; | 1038 autorelease]; |
1039 [panelView setOverlayType:PanelOverlayTypeFromSignInPanelsType(panelType)]; | 1039 [panelView setOverlayType:PanelOverlayTypeFromSignInPanelsType(panelType)]; |
1040 [_tabSwitcherView addPanelView:panelView atIndex:kSignInPromoPanelIndex]; | 1040 [_tabSwitcherView addPanelView:panelView atIndex:kSignInPromoPanelIndex]; |
1041 } | 1041 } |
1042 } | 1042 } |
1043 | 1043 |
1044 - (CGSize)sizeForItemAtIndex:(NSUInteger)index | 1044 - (CGSize)sizeForItemAtIndex:(NSUInteger)index |
1045 inSession:(ios_internal::SessionType)session { | 1045 inSession:(TabSwitcherSessionType)session { |
1046 switch (session) { | 1046 switch (session) { |
1047 case ios_internal::SessionType::OFF_THE_RECORD_SESSION: | 1047 case TabSwitcherSessionType::OFF_THE_RECORD_SESSION: |
1048 return [[_offTheRecordSession view] cellSize]; | 1048 return [[_offTheRecordSession view] cellSize]; |
1049 case ios_internal::SessionType::REGULAR_SESSION: | 1049 case TabSwitcherSessionType::REGULAR_SESSION: |
1050 return [[_onTheRecordSession view] cellSize]; | 1050 return [[_onTheRecordSession view] cellSize]; |
1051 case ios_internal::SessionType::DISTANT_SESSION: | 1051 case TabSwitcherSessionType::DISTANT_SESSION: |
1052 NOTREACHED(); | 1052 NOTREACHED(); |
1053 return {}; | 1053 return {}; |
1054 } | 1054 } |
1055 } | 1055 } |
1056 | 1056 |
1057 #pragma mark - TabSwitcherHeaderViewDelegate | 1057 #pragma mark - TabSwitcherHeaderViewDelegate |
1058 | 1058 |
1059 - (void)tabSwitcherHeaderViewDismiss:(TabSwitcherHeaderView*)view { | 1059 - (void)tabSwitcherHeaderViewDismiss:(TabSwitcherHeaderView*)view { |
1060 [self tabSwitcherDismissWithCurrentSelectedModel]; | 1060 [self tabSwitcherDismissWithCurrentSelectedModel]; |
1061 } | 1061 } |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 NSString* cellTitle = nil; | 1103 NSString* cellTitle = nil; |
1104 | 1104 |
1105 if (index < _controllersOfDistantSessions.get().count) { | 1105 if (index < _controllersOfDistantSessions.get().count) { |
1106 TabSwitcherPanelController* panel = | 1106 TabSwitcherPanelController* panel = |
1107 [_controllersOfDistantSessions objectAtIndex:index]; | 1107 [_controllersOfDistantSessions objectAtIndex:index]; |
1108 const synced_sessions::DistantSession* distantSession = | 1108 const synced_sessions::DistantSession* distantSession = |
1109 [panel distantSession]; | 1109 [panel distantSession]; |
1110 deviceType = distantSession->device_type; | 1110 deviceType = distantSession->device_type; |
1111 cellTitle = base::SysUTF8ToNSString(distantSession->name); | 1111 cellTitle = base::SysUTF8ToNSString(distantSession->name); |
1112 } | 1112 } |
1113 ios_internal::SessionCellType cellType; | 1113 TabSwitcherSessionCellType cellType; |
1114 switch (deviceType) { | 1114 switch (deviceType) { |
1115 case sync_sessions::SyncedSession::TYPE_PHONE: | 1115 case sync_sessions::SyncedSession::TYPE_PHONE: |
1116 cellType = ios_internal::kPhoneRemoteSessionCell; | 1116 cellType = kPhoneRemoteSessionCell; |
1117 break; | 1117 break; |
1118 case sync_sessions::SyncedSession::TYPE_TABLET: | 1118 case sync_sessions::SyncedSession::TYPE_TABLET: |
1119 cellType = ios_internal::kTabletRemoteSessionCell; | 1119 cellType = kTabletRemoteSessionCell; |
1120 break; | 1120 break; |
1121 default: | 1121 default: |
1122 cellType = ios_internal::kLaptopRemoteSessionCell; | 1122 cellType = kLaptopRemoteSessionCell; |
1123 break; | 1123 break; |
1124 } | 1124 } |
1125 SessionCellData* sessionData = [[[SessionCellData alloc] | 1125 SessionCellData* sessionData = [[[SessionCellData alloc] |
1126 initWithSessionCellType:cellType] autorelease]; | 1126 initWithSessionCellType:cellType] autorelease]; |
1127 sessionData.title = cellTitle; | 1127 sessionData.title = cellTitle; |
1128 return sessionData; | 1128 return sessionData; |
1129 } | 1129 } |
1130 } | 1130 } |
1131 } | 1131 } |
1132 | 1132 |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1200 DCHECK(tab); | 1200 DCHECK(tab); |
1201 [self openTabWithContentOfDistantTab:tab]; | 1201 [self openTabWithContentOfDistantTab:tab]; |
1202 base::RecordAction( | 1202 base::RecordAction( |
1203 base::UserMetricsAction("MobileTabSwitcherOpenDistantTab")); | 1203 base::UserMetricsAction("MobileTabSwitcherOpenDistantTab")); |
1204 } | 1204 } |
1205 | 1205 |
1206 - (void)tabSwitcherPanelController: | 1206 - (void)tabSwitcherPanelController: |
1207 (TabSwitcherPanelController*)tabSwitcherPanelController | 1207 (TabSwitcherPanelController*)tabSwitcherPanelController |
1208 didSelectLocalTab:(Tab*)tab { | 1208 didSelectLocalTab:(Tab*)tab { |
1209 DCHECK(tab); | 1209 DCHECK(tab); |
1210 const ios_internal::SessionType panelSessionType = | 1210 const TabSwitcherSessionType panelSessionType = |
1211 tabSwitcherPanelController.sessionType; | 1211 tabSwitcherPanelController.sessionType; |
1212 TabModel* tabModel = [self tabModelForSessionType:panelSessionType]; | 1212 TabModel* tabModel = [self tabModelForSessionType:panelSessionType]; |
1213 [tabModel setCurrentTab:tab]; | 1213 [tabModel setCurrentTab:tab]; |
1214 [self.delegate tabSwitcher:self | 1214 [self.delegate tabSwitcher:self |
1215 dismissTransitionWillStartWithActiveModel:tabModel]; | 1215 dismissTransitionWillStartWithActiveModel:tabModel]; |
1216 [self tabSwitcherDismissWithModel:tabModel]; | 1216 [self tabSwitcherDismissWithModel:tabModel]; |
1217 if (panelSessionType == ios_internal::SessionType::OFF_THE_RECORD_SESSION) { | 1217 if (panelSessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) { |
1218 base::RecordAction( | 1218 base::RecordAction( |
1219 base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab")); | 1219 base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab")); |
1220 } else { | 1220 } else { |
1221 base::RecordAction( | 1221 base::RecordAction( |
1222 base::UserMetricsAction("MobileTabSwitcherOpenNonIncognitoTab")); | 1222 base::UserMetricsAction("MobileTabSwitcherOpenNonIncognitoTab")); |
1223 } | 1223 } |
1224 } | 1224 } |
1225 | 1225 |
1226 - (void)tabSwitcherPanelController: | 1226 - (void)tabSwitcherPanelController: |
1227 (TabSwitcherPanelController*)tabSwitcherPanelController | 1227 (TabSwitcherPanelController*)tabSwitcherPanelController |
1228 didCloseLocalTab:(Tab*)tab { | 1228 didCloseLocalTab:(Tab*)tab { |
1229 DCHECK(tab); | 1229 DCHECK(tab); |
1230 const ios_internal::SessionType panelSessionType = | 1230 const TabSwitcherSessionType panelSessionType = |
1231 tabSwitcherPanelController.sessionType; | 1231 tabSwitcherPanelController.sessionType; |
1232 [tab close]; | 1232 [tab close]; |
1233 if (panelSessionType == ios_internal::SessionType::OFF_THE_RECORD_SESSION) { | 1233 if (panelSessionType == TabSwitcherSessionType::OFF_THE_RECORD_SESSION) { |
1234 base::RecordAction( | 1234 base::RecordAction( |
1235 base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab")); | 1235 base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab")); |
1236 } else { | 1236 } else { |
1237 base::RecordAction( | 1237 base::RecordAction( |
1238 base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab")); | 1238 base::UserMetricsAction("MobileTabSwitcherCloseNonIncognitoTab")); |
1239 } | 1239 } |
1240 } | 1240 } |
1241 | 1241 |
1242 - (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: | 1242 - (void)tabSwitcherPanelControllerDidUpdateOverlayViewVisibility: |
1243 (TabSwitcherPanelController*)tabSwitcherPanelController { | 1243 (TabSwitcherPanelController*)tabSwitcherPanelController { |
1244 [_tabSwitcherView updateOverlayButtonState]; | 1244 [_tabSwitcherView updateOverlayButtonState]; |
1245 } | 1245 } |
1246 | 1246 |
1247 @end | 1247 @end |
OLD | NEW |