| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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/history/history_entry_item.h" | 5 #import "ios/chrome/browser/ui/history/history_entry_item.h" |
| 6 | 6 |
| 7 #include "base/i18n/time_formatting.h" | 7 #include "base/i18n/time_formatting.h" |
| 8 #import "base/mac/foundation_util.h" | 8 #import "base/mac/foundation_util.h" |
| 9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 189 return YES; | 189 return YES; |
| 190 } | 190 } |
| 191 | 191 |
| 192 - (void)configureCell:(HistoryEntryCell*)cell { | 192 - (void)configureCell:(HistoryEntryCell*)cell { |
| 193 [super configureCell:cell]; | 193 [super configureCell:cell]; |
| 194 | 194 |
| 195 // Set favicon view and constraints. | 195 // Set favicon view and constraints. |
| 196 FaviconView* faviconView = self.faviconViewProvider.faviconView; | 196 FaviconView* faviconView = self.faviconViewProvider.faviconView; |
| 197 [cell.faviconViewContainer addSubview:faviconView]; | 197 [cell.faviconViewContainer addSubview:faviconView]; |
| 198 [faviconView setTranslatesAutoresizingMaskIntoConstraints:NO]; | 198 [faviconView setTranslatesAutoresizingMaskIntoConstraints:NO]; |
| 199 AddSameSizeConstraint(faviconView, cell.faviconViewContainer); | 199 AddSameConstraints(faviconView, cell.faviconViewContainer); |
| 200 AddSameCenterConstraints(faviconView, cell.faviconViewContainer); | |
| 201 | 200 |
| 202 cell.textLabel.text = self.text; | 201 cell.textLabel.text = self.text; |
| 203 cell.detailTextLabel.text = self.detailText; | 202 cell.detailTextLabel.text = self.detailText; |
| 204 cell.timeLabel.text = self.timeText; | 203 cell.timeLabel.text = self.timeText; |
| 205 cell.isAccessibilityElement = YES; | 204 cell.isAccessibilityElement = YES; |
| 206 cell.accessibilityCustomActions = self.accessibilityActions; | 205 cell.accessibilityCustomActions = self.accessibilityActions; |
| 207 cell.accessibilityLabel = | 206 cell.accessibilityLabel = |
| 208 l10n_util::GetNSStringF(IDS_HISTORY_ENTRY_ACCESSIBILITY_LABEL, | 207 l10n_util::GetNSStringF(IDS_HISTORY_ENTRY_ACCESSIBILITY_LABEL, |
| 209 base::SysNSStringToUTF16(self.text), | 208 base::SysNSStringToUTF16(self.text), |
| 210 base::SysNSStringToUTF16(self.detailText), | 209 base::SysNSStringToUTF16(self.detailText), |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 [super prepareForReuse]; | 300 [super prepareForReuse]; |
| 302 _textLabel.text = nil; | 301 _textLabel.text = nil; |
| 303 _detailTextLabel.text = nil; | 302 _detailTextLabel.text = nil; |
| 304 _timeLabel.text = nil; | 303 _timeLabel.text = nil; |
| 305 for (UIView* subview in _faviconViewContainer.subviews) { | 304 for (UIView* subview in _faviconViewContainer.subviews) { |
| 306 [subview removeFromSuperview]; | 305 [subview removeFromSuperview]; |
| 307 } | 306 } |
| 308 } | 307 } |
| 309 | 308 |
| 310 @end | 309 @end |
| OLD | NEW |