Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(751)

Side by Side Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_article_item.mm

Issue 2708623002: Add an ID to the ContentSuggestion (Closed)
Patch Set: Add tests Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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/content_suggestions/content_suggestions_article_i tem.h" 5 #import "ios/chrome/browser/ui/content_suggestions/content_suggestions_article_i tem.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #import "ios/chrome/browser/ui/uikit_ui_util.h" 8 #import "ios/chrome/browser/ui/uikit_ui_util.h"
9 9
10 #if !defined(__has_feature) || !__has_feature(objc_arc) 10 #if !defined(__has_feature) || !__has_feature(objc_arc)
(...skipping 14 matching lines...) Expand all
25 #pragma mark - ContentSuggestionsArticleItem 25 #pragma mark - ContentSuggestionsArticleItem
26 26
27 @implementation ContentSuggestionsArticleItem 27 @implementation ContentSuggestionsArticleItem
28 28
29 @synthesize title = _title; 29 @synthesize title = _title;
30 @synthesize subtitle = _subtitle; 30 @synthesize subtitle = _subtitle;
31 @synthesize image = _image; 31 @synthesize image = _image;
32 @synthesize articleURL = _articleURL; 32 @synthesize articleURL = _articleURL;
33 @synthesize publisher = _publisher; 33 @synthesize publisher = _publisher;
34 @synthesize publishDate = _publishDate; 34 @synthesize publishDate = _publishDate;
35 @synthesize suggestionIdentifier = _suggestionIdentifier;
35 36
36 - (instancetype)initWithType:(NSInteger)type 37 - (instancetype)initWithType:(NSInteger)type
37 title:(NSString*)title 38 title:(NSString*)title
38 subtitle:(NSString*)subtitle 39 subtitle:(NSString*)subtitle
39 image:(UIImage*)image 40 image:(UIImage*)image
40 url:(const GURL&)url { 41 url:(const GURL&)url {
41 self = [super initWithType:type]; 42 self = [super initWithType:type];
42 if (self) { 43 if (self) {
43 self.cellClass = [ContentSuggestionsArticleCell class]; 44 self.cellClass = [ContentSuggestionsArticleCell class];
44 _title = [title copy]; 45 _title = [title copy];
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 CGFloat parentWidth = CGRectGetWidth(self.contentView.bounds); 154 CGFloat parentWidth = CGRectGetWidth(self.contentView.bounds);
154 self.subtitleLabel.preferredMaxLayoutWidth = 155 self.subtitleLabel.preferredMaxLayoutWidth =
155 parentWidth - self.imageView.bounds.size.width - 3 * 8; 156 parentWidth - self.imageView.bounds.size.width - 3 * 8;
156 157
157 // Re-layout with the new preferred width to allow the label to adjust its 158 // Re-layout with the new preferred width to allow the label to adjust its
158 // height. 159 // height.
159 [super layoutSubviews]; 160 [super layoutSubviews];
160 } 161 }
161 162
162 @end 163 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698