Chromium Code Reviews| Index: ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm |
| diff --git a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm |
| index 16060190891ff3c618498367f3254eb632aea4f8..b9f714a59cc6f505b308523ff8e8458b020796b9 100644 |
| --- a/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm |
| +++ b/ios/chrome/browser/ui/tab_switcher/tab_switcher_controller.mm |
| @@ -136,12 +136,12 @@ enum class SnapshotViewOption { |
| - (NSInteger)currentPanelIndex; |
| // Returns the session type of the panel and the given index. |
| -- (ios_internal::SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex; |
| +- (SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex; |
| // Returns the tab model corresponding to the given session type. |
| // There is no tab model for distant sessions so it returns nil for distant |
| // sessions type. |
| -- (TabModel*)tabModelForSessionType:(ios_internal::SessionType)sessionType; |
| +- (TabModel*)tabModelForSessionType:(SessionType)sessionType; |
| // Returns the tab model of the currently selected tab. |
| - (TabModel*)currentSelectedModel; |
| @@ -207,13 +207,13 @@ enum class SnapshotViewOption { |
| [self loadTabSwitcherView]; |
| _onTheRecordSession.reset([[TabSwitcherPanelController alloc] |
| initWithModel:_tabSwitcherModel |
| - forLocalSessionOfType:ios_internal::SessionType::REGULAR_SESSION |
| + forLocalSessionOfType:SessionType::REGULAR_SESSION |
| withCache:_cache |
| browserState:_browserState]); |
| [_onTheRecordSession setDelegate:self]; |
| _offTheRecordSession.reset([[TabSwitcherPanelController alloc] |
| initWithModel:_tabSwitcherModel |
| - forLocalSessionOfType:ios_internal::SessionType::OFF_THE_RECORD_SESSION |
| + forLocalSessionOfType:SessionType::OFF_THE_RECORD_SESSION |
| withCache:_cache |
| browserState:_browserState]); |
| [_offTheRecordSession setDelegate:self]; |
| @@ -392,10 +392,9 @@ enum class SnapshotViewOption { |
| : kLocalTabsOffTheRecordPanelIndex; |
| [_tabSwitcherView selectPanelAtIndex:panelIndex]; |
| - const ios_internal::SessionType panelSessionType = |
| - (command == IDC_NEW_TAB) |
| - ? ios_internal::SessionType::REGULAR_SESSION |
| - : ios_internal::SessionType::OFF_THE_RECORD_SESSION; |
| + const SessionType panelSessionType = |
| + (command == IDC_NEW_TAB) ? SessionType::REGULAR_SESSION |
| + : SessionType::OFF_THE_RECORD_SESSION; |
| TabModel* model = [self tabModelForSessionType:panelSessionType]; |
| [self dismissWithNewTabAnimation:GURL(kChromeUINewTabURL) |
| @@ -737,23 +736,23 @@ enum class SnapshotViewOption { |
| return kSignInPromoPanelIndex + 1; |
| } |
| -- (ios_internal::SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex { |
| +- (SessionType)sessionTypeForPanelIndex:(NSInteger)panelIndex { |
| if (panelIndex == kLocalTabsOffTheRecordPanelIndex) |
| - return ios_internal::SessionType::OFF_THE_RECORD_SESSION; |
| + return SessionType::OFF_THE_RECORD_SESSION; |
| if (panelIndex == kLocalTabsOnTheRecordPanelIndex) |
| - return ios_internal::SessionType::REGULAR_SESSION; |
| - return ios_internal::SessionType::DISTANT_SESSION; |
| + return SessionType::REGULAR_SESSION; |
| + return SessionType::DISTANT_SESSION; |
| } |
| -- (TabModel*)tabModelForSessionType:(ios_internal::SessionType)sessionType { |
| +- (TabModel*)tabModelForSessionType:(SessionType)sessionType { |
| switch (sessionType) { |
| - case ios_internal::SessionType::REGULAR_SESSION: |
| + case SessionType::REGULAR_SESSION: |
| return [_tabSwitcherModel mainTabModel]; |
| break; |
| - case ios_internal::SessionType::OFF_THE_RECORD_SESSION: |
| + case SessionType::OFF_THE_RECORD_SESSION: |
| return [_tabSwitcherModel otrTabModel]; |
| break; |
| - case ios_internal::SessionType::DISTANT_SESSION: |
| + case SessionType::DISTANT_SESSION: |
| return nil; |
| break; |
| } |
| @@ -761,7 +760,7 @@ enum class SnapshotViewOption { |
| - (TabModel*)currentSelectedModel { |
| const NSInteger currentPanelIndex = [self currentPanelIndex]; |
| - const ios_internal::SessionType sessionType = |
| + const SessionType sessionType = |
| [self sessionTypeForPanelIndex:currentPanelIndex]; |
| TabModel* model = [self tabModelForSessionType:sessionType]; |
| if (!model) |
| @@ -1003,11 +1002,11 @@ enum class SnapshotViewOption { |
| } |
| } |
| -- (void)localSessionMayNeedUpdate:(ios_internal::SessionType)type { |
| - if (type == ios_internal::SessionType::REGULAR_SESSION) { |
| +- (void)localSessionMayNeedUpdate:(SessionType)type { |
| + if (type == SessionType::REGULAR_SESSION) { |
|
sdefresne
2017/01/03 16:04:30
nit: it would be better to use a switch statement
rohitrao (ping after 24h)
2017/01/04 13:36:37
Acknowledged.
|
| [_onTheRecordSession updateCollectionViewIfNeeded]; |
| } else { |
| - DCHECK(type == ios_internal::SessionType::OFF_THE_RECORD_SESSION); |
| + DCHECK(type == SessionType::OFF_THE_RECORD_SESSION); |
| [_offTheRecordSession updateCollectionViewIfNeeded]; |
| } |
| } |
| @@ -1041,14 +1040,13 @@ enum class SnapshotViewOption { |
| } |
| } |
| -- (CGSize)sizeForItemAtIndex:(NSUInteger)index |
| - inSession:(ios_internal::SessionType)session { |
| +- (CGSize)sizeForItemAtIndex:(NSUInteger)index inSession:(SessionType)session { |
| switch (session) { |
| - case ios_internal::SessionType::OFF_THE_RECORD_SESSION: |
| + case SessionType::OFF_THE_RECORD_SESSION: |
| return [[_offTheRecordSession view] cellSize]; |
| - case ios_internal::SessionType::REGULAR_SESSION: |
| + case SessionType::REGULAR_SESSION: |
| return [[_onTheRecordSession view] cellSize]; |
| - case ios_internal::SessionType::DISTANT_SESSION: |
| + case SessionType::DISTANT_SESSION: |
| NOTREACHED(); |
| return {}; |
| } |
| @@ -1110,16 +1108,16 @@ enum class SnapshotViewOption { |
| deviceType = distantSession->device_type; |
| cellTitle = base::SysUTF8ToNSString(distantSession->name); |
| } |
| - ios_internal::SessionCellType cellType; |
| + SessionCellType cellType; |
| switch (deviceType) { |
| case sync_sessions::SyncedSession::TYPE_PHONE: |
| - cellType = ios_internal::kPhoneRemoteSessionCell; |
| + cellType = kPhoneRemoteSessionCell; |
| break; |
| case sync_sessions::SyncedSession::TYPE_TABLET: |
| - cellType = ios_internal::kTabletRemoteSessionCell; |
| + cellType = kTabletRemoteSessionCell; |
| break; |
| default: |
| - cellType = ios_internal::kLaptopRemoteSessionCell; |
| + cellType = kLaptopRemoteSessionCell; |
| break; |
| } |
| SessionCellData* sessionData = [[[SessionCellData alloc] |
| @@ -1207,14 +1205,13 @@ enum class SnapshotViewOption { |
| (TabSwitcherPanelController*)tabSwitcherPanelController |
| didSelectLocalTab:(Tab*)tab { |
| DCHECK(tab); |
| - const ios_internal::SessionType panelSessionType = |
| - tabSwitcherPanelController.sessionType; |
| + const SessionType panelSessionType = tabSwitcherPanelController.sessionType; |
| TabModel* tabModel = [self tabModelForSessionType:panelSessionType]; |
| [tabModel setCurrentTab:tab]; |
| [self.delegate tabSwitcher:self |
| dismissTransitionWillStartWithActiveModel:tabModel]; |
| [self tabSwitcherDismissWithModel:tabModel]; |
| - if (panelSessionType == ios_internal::SessionType::OFF_THE_RECORD_SESSION) { |
| + if (panelSessionType == SessionType::OFF_THE_RECORD_SESSION) { |
| base::RecordAction( |
| base::UserMetricsAction("MobileTabSwitcherOpenIncognitoTab")); |
| } else { |
| @@ -1227,10 +1224,9 @@ enum class SnapshotViewOption { |
| (TabSwitcherPanelController*)tabSwitcherPanelController |
| didCloseLocalTab:(Tab*)tab { |
| DCHECK(tab); |
| - const ios_internal::SessionType panelSessionType = |
| - tabSwitcherPanelController.sessionType; |
| + const SessionType panelSessionType = tabSwitcherPanelController.sessionType; |
| [tab close]; |
| - if (panelSessionType == ios_internal::SessionType::OFF_THE_RECORD_SESSION) { |
| + if (panelSessionType == SessionType::OFF_THE_RECORD_SESSION) { |
| base::RecordAction( |
| base::UserMetricsAction("MobileTabSwitcherCloseIncognitoTab")); |
| } else { |