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

Side by Side Diff: ios/chrome/browser/ui/favicon_view.mm

Issue 2567203002: Revert of [ObjC ARC] Converts ios/chrome/browser/ui:ui to ARC. (Closed)
Patch Set: Created 4 years 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
« no previous file with comments | « ios/chrome/browser/ui/browser_otr_state.mm ('k') | ios/chrome/browser/ui/file_locations.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/favicon_view.h" 5 #import "ios/chrome/browser/ui/favicon_view.h"
6 6
7 #include "base/mac/objc_property_releaser.h"
7 #import "ios/chrome/browser/ui/uikit_ui_util.h" 8 #import "ios/chrome/browser/ui/uikit_ui_util.h"
8 9
9 #if !defined(__has_feature) || !__has_feature(objc_arc)
10 #error "This file requires ARC support."
11 #endif
12
13 namespace { 10 namespace {
14 // Default corner radius for the favicon image view. 11 // Default corner radius for the favicon image view.
15 const CGFloat kDefaultCornerRadius = 3; 12 const CGFloat kDefaultCornerRadius = 3;
16 } 13 }
17 14
18 @interface FaviconViewNew () { 15 @interface FaviconViewNew () {
19 // Property releaser for FaviconViewNew. 16 // Property releaser for FaviconViewNew.
17 base::mac::ObjCPropertyReleaser _propertyReleaser_FaviconViewNew;
20 } 18 }
21 19
22 // Image view for the favicon. 20 // Image view for the favicon.
23 @property(nonatomic, strong) UIImageView* faviconImageView; 21 @property(nonatomic, retain) UIImageView* faviconImageView;
24 // Label for fallback favicon placeholder. 22 // Label for fallback favicon placeholder.
25 @property(nonatomic, strong) UILabel* faviconFallbackLabel; 23 @property(nonatomic, retain) UILabel* faviconFallbackLabel;
26 24
27 @end 25 @end
28 26
29 @implementation FaviconViewNew 27 @implementation FaviconViewNew
30 @synthesize faviconImageView = _faviconImageView; 28 @synthesize faviconImageView = _faviconImageView;
31 @synthesize faviconFallbackLabel = _faviconFallbackLabel; 29 @synthesize faviconFallbackLabel = _faviconFallbackLabel;
32 30
33 - (instancetype)initWithFrame:(CGRect)frame { 31 - (instancetype)initWithFrame:(CGRect)frame {
34 self = [super initWithFrame:frame]; 32 self = [super initWithFrame:frame];
35 if (self) { 33 if (self) {
34 _propertyReleaser_FaviconViewNew.Init(self, [FaviconViewNew class]);
36 _faviconImageView = [[UIImageView alloc] initWithFrame:self.bounds]; 35 _faviconImageView = [[UIImageView alloc] initWithFrame:self.bounds];
37 _faviconImageView.clipsToBounds = YES; 36 _faviconImageView.clipsToBounds = YES;
38 _faviconImageView.layer.cornerRadius = kDefaultCornerRadius; 37 _faviconImageView.layer.cornerRadius = kDefaultCornerRadius;
39 _faviconImageView.image = nil; 38 _faviconImageView.image = nil;
40 39
41 _faviconFallbackLabel = [[UILabel alloc] initWithFrame:self.bounds]; 40 _faviconFallbackLabel = [[UILabel alloc] initWithFrame:self.bounds];
42 _faviconFallbackLabel.backgroundColor = [UIColor clearColor]; 41 _faviconFallbackLabel.backgroundColor = [UIColor clearColor];
43 _faviconFallbackLabel.textAlignment = NSTextAlignmentCenter; 42 _faviconFallbackLabel.textAlignment = NSTextAlignmentCenter;
44 _faviconFallbackLabel.isAccessibilityElement = NO; 43 _faviconFallbackLabel.isAccessibilityElement = NO;
45 _faviconFallbackLabel.clipsToBounds = YES; 44 _faviconFallbackLabel.clipsToBounds = YES;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 self.faviconFallbackLabel.font = font; 78 self.faviconFallbackLabel.font = font;
80 } 79 }
81 80
82 #pragma mark - UIView 81 #pragma mark - UIView
83 82
84 - (CGSize)intrinsicContentSize { 83 - (CGSize)intrinsicContentSize {
85 return CGSizeMake(kFaviconPreferredSize, kFaviconPreferredSize); 84 return CGSizeMake(kFaviconPreferredSize, kFaviconPreferredSize);
86 } 85 }
87 86
88 @end 87 @end
OLDNEW
« no previous file with comments | « ios/chrome/browser/ui/browser_otr_state.mm ('k') | ios/chrome/browser/ui/file_locations.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698