Commit 1fa2688a authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Fix height issue when TableViewUrlCell doesn't have title or host.

- Require minimum height equal the height of the favicon for the vertical stackview in TableViewUrlCell
- If title and host aren't available, use full url spec.

Screenshot: https://drive.google.com/file/d/1C19zooJG80phfS6gDiCnMZQa2NZJd9zA/view?usp=sharing

Bug: 878833
Change-Id: I11e91f583f014f88a208478bef767cb70972ce7b
Reviewed-on: https://chromium-review.googlesource.com/1235319
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593303}
parent a875acbb
...@@ -88,8 +88,14 @@ const char kDefaultSupplementalURLTextDelimiter[] = "•"; ...@@ -88,8 +88,14 @@ const char kDefaultSupplementalURLTextDelimiter[] = "•";
// Returns the text to use when configuring a TableViewURLCell's title label. // Returns the text to use when configuring a TableViewURLCell's title label.
- (NSString*)titleLabelText { - (NSString*)titleLabelText {
return self.title.length ? self.title if (self.title.length) {
: base::SysUTF8ToNSString(self.URL.host()); return self.title;
} else if (base::SysUTF8ToNSString(self.URL.host()).length) {
return base::SysUTF8ToNSString(self.URL.host());
} else {
// Backup in case host returns nothing (e.g. about:blank).
return base::SysUTF8ToNSString(self.URL.spec());
}
} }
// Returns the text to use when configuring a TableViewURLCell's URL label. // Returns the text to use when configuring a TableViewURLCell's URL label.
......
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