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

Unified Diff: ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.mm

Issue 2761753002: Cleanup ContentSuggestions cells (Closed)
Patch Set: Fix tests Created 3 years, 9 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 side-by-side diff with in-line comments
Download patch
Index: ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.mm
diff --git a/ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.mm b/ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.mm
deleted file mode 100644
index e00c16bb7b12a5a9dbc5740a9d38658af86fc366..0000000000000000000000000000000000000000
--- a/ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.mm
+++ /dev/null
@@ -1,70 +0,0 @@
-// Copyright 2017 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#import "ios/chrome/browser/ui/content_suggestions/content_suggestions_favicon_internal_cell.h"
-
-#import "ios/chrome/browser/ui/uikit_ui_util.h"
-#import "ios/third_party/material_components_ios/src/components/Typography/src/MaterialTypography.h"
-
-#if !defined(__has_feature) || !__has_feature(objc_arc)
-#error "This file requires ARC support."
-#endif
-
-namespace {
-const CGFloat kFaviconImageSize = 50;
-const CGFloat kFontSize = 10;
-}
-
-@implementation ContentSuggestionsFaviconInternalCell
-
-@synthesize faviconView = _faviconView;
-@synthesize titleLabel = _titleLabel;
-
-- (instancetype)initWithFrame:(CGRect)frame {
- self = [super initWithFrame:frame];
- if (self) {
- _faviconView = [[UIImageView alloc] init];
- _titleLabel = [[UILabel alloc] init];
- _titleLabel.numberOfLines = 2;
- _titleLabel.font = [[MDCTypography fontLoader] lightFontOfSize:kFontSize];
- _titleLabel.textAlignment = NSTextAlignmentCenter;
-
- _faviconView.translatesAutoresizingMaskIntoConstraints = NO;
- _titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
- [self.contentView addSubview:_faviconView];
- [self.contentView addSubview:_titleLabel];
-
- ApplyVisualConstraints(
- @[ @"V:|-[image]-[title]-|" ],
- @{ @"image" : _faviconView,
- @"title" : _titleLabel });
-
- [NSLayoutConstraint activateConstraints:@[
- [_faviconView.centerXAnchor
- constraintEqualToAnchor:self.contentView.centerXAnchor],
- [_titleLabel.leadingAnchor
- constraintEqualToAnchor:self.contentView.leadingAnchor],
- [_titleLabel.trailingAnchor
- constraintEqualToAnchor:self.contentView.trailingAnchor],
- [_faviconView.widthAnchor constraintEqualToConstant:kFaviconImageSize],
- [_faviconView.heightAnchor
- constraintEqualToAnchor:_faviconView.widthAnchor],
- ]];
- }
- return self;
-}
-
-#pragma mark - UICollectionReusableView
-
-- (void)prepareForReuse {
- [super prepareForReuse];
- self.faviconView.image = nil;
- self.titleLabel.text = nil;
-}
-
-+ (NSString*)reuseIdentifier {
- return @"faviconInternalCell";
-}
-
-@end

Powered by Google App Engine
This is Rietveld 408576698