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

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: 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 #import "ios/chrome/browser/ui/uikit_ui_util.h" 7 #import "ios/chrome/browser/ui/uikit_ui_util.h"
8 8
9 #if !defined(__has_feature) || !__has_feature(objc_arc) 9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support." 10 #error "This file requires ARC support."
(...skipping 12 matching lines...) Expand all
23 @end 23 @end
24 24
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 suggestionID = _suggestionID;
33 34
34 - (instancetype)initWithType:(NSInteger)type 35 - (instancetype)initWithType:(NSInteger)type
35 title:(NSString*)title 36 title:(NSString*)title
36 subtitle:(NSString*)subtitle 37 subtitle:(NSString*)subtitle
37 image:(UIImage*)image 38 image:(UIImage*)image
38 url:(const GURL&)url { 39 url:(const GURL&)url {
39 self = [super initWithType:type]; 40 self = [super initWithType:type];
40 if (self) { 41 if (self) {
41 self.cellClass = [ContentSuggestionsArticleCell class]; 42 self.cellClass = [ContentSuggestionsArticleCell class];
42 _title = [title copy]; 43 _title = [title copy];
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 // changes, for instance on screen rotation. 121 // changes, for instance on screen rotation.
121 CGFloat parentWidth = CGRectGetWidth(self.contentView.bounds); 122 CGFloat parentWidth = CGRectGetWidth(self.contentView.bounds);
122 self.subtitleLabel.preferredMaxLayoutWidth = parentWidth - kImageSize - 3 * 8; 123 self.subtitleLabel.preferredMaxLayoutWidth = parentWidth - kImageSize - 3 * 8;
123 124
124 // Re-layout with the new preferred width to allow the label to adjust its 125 // Re-layout with the new preferred width to allow the label to adjust its
125 // height. 126 // height.
126 [super layoutSubviews]; 127 [super layoutSubviews];
127 } 128 }
128 129
129 @end 130 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698