Commit 15272e42 authored by sczs's avatar sczs Committed by Commit Bot

[ios] Uses header dynamic height on RecentTabs iOS11

Re-introduces dynamic header height on Recent Tabs for iOS11.
Originally this was removed because of an iOS10 bug, but
there's no need to stop supporting dynamic height on iOS11.

Bug: 862744
Cq-Include-Trybots: luci.chromium.try:ios-simulator-full-configs;master.tryserver.chromium.mac:ios-simulator-cronet
Change-Id: I17ec0f4b2257b23c24d8ed3e285efce023e3e141
Reviewed-on: https://chromium-review.googlesource.com/1142697
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarKurt Horimoto <kkhorimoto@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576298}
parent 81e7776e
......@@ -157,6 +157,8 @@ const int kRecentlyClosedTabsSectionIndex = 0;
[self.tableView setDelegate:self];
self.tableView.cellLayoutMarginsFollowReadableWidth = NO;
self.tableView.estimatedRowHeight = kEstimatedRowHeight;
if (@available(iOS 11.0, *))
self.tableView.estimatedSectionHeaderHeight = kEstimatedRowHeight;
self.tableView.rowHeight = UITableViewAutomaticDimension;
self.tableView.sectionFooterHeight = 0.0;
self.title = l10n_util::GetNSString(IDS_IOS_CONTENT_SUGGESTIONS_RECENT_TABS);
......@@ -640,15 +642,19 @@ const int kRecentlyClosedTabsSectionIndex = 0;
- (CGFloat)tableView:(UITableView*)tableView
heightForHeaderInSection:(NSInteger)section {
DCHECK_EQ(tableView, self.tableView);
NSInteger sectionIdentifier =
[self.tableViewModel sectionIdentifierForSection:section];
switch (sectionIdentifier) {
case SectionIdentifierRecentlyClosedTabs:
case SectionIdentifierOtherDevices:
return kSingleLineSectionHeaderHeight;
default:
// All remote session sections.
return kDoubleLineSectionHeaderHeight;
if (@available(iOS 11, *)) {
return UITableViewAutomaticDimension;
} else {
NSInteger sectionIdentifier =
[self.tableViewModel sectionIdentifierForSection:section];
switch (sectionIdentifier) {
case SectionIdentifierRecentlyClosedTabs:
case SectionIdentifierOtherDevices:
return kSingleLineSectionHeaderHeight;
default:
// All remote session sections.
return kDoubleLineSectionHeaderHeight;
}
}
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment