Commit e8747d07 authored by Chris Lu's avatar Chris Lu Committed by Commit Bot

[ios] Check length of Title of TableViewUrlItem

Oftentimes if nothing in title, it is an empty string, not nil.

Bug: 851162
Change-Id: Ib6a4045cbad6580ceb9ab7663c974bad4359360e
Reviewed-on: https://chromium-review.googlesource.com/1093888
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Reviewed-by: default avatarSergio Collazos <sczs@chromium.org>
Cr-Commit-Position: refs/heads/master@{#566028}
parent e6066690
...@@ -44,11 +44,11 @@ const CGFloat kFaviconContainerWidth = 28; ...@@ -44,11 +44,11 @@ const CGFloat kFaviconContainerWidth = 28;
TableViewURLCell* cell = TableViewURLCell* cell =
base::mac::ObjCCastStrict<TableViewURLCell>(tableCell); base::mac::ObjCCastStrict<TableViewURLCell>(tableCell);
// Use the page's title for the label, or its URL if title is empty. // Use the page's title for the label, or its URL if title is empty.
if (self.title) { if ([self.title length] == 0) {
cell.titleLabel.text = base::SysUTF8ToNSString(self.URL.host());
} else {
cell.titleLabel.text = self.title; cell.titleLabel.text = self.title;
cell.URLLabel.text = base::SysUTF8ToNSString(self.URL.host()); cell.URLLabel.text = base::SysUTF8ToNSString(self.URL.host());
} else {
cell.titleLabel.text = base::SysUTF8ToNSString(self.URL.host());
} }
cell.metadataLabel.text = self.metadata; cell.metadataLabel.text = self.metadata;
cell.metadataLabel.hidden = ([self.metadata length] == 0); cell.metadataLabel.hidden = ([self.metadata length] == 0);
......
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