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

Unified Diff: ios/chrome/browser/ui/history/favicon_view_provider.mm

Issue 2624963003: [ObjC ARC] Converts ios/chrome/browser/ui/history:history to ARC. (Closed)
Patch Set: Reparent and fix tests Created 3 years, 11 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/history/favicon_view_provider.mm
diff --git a/ios/chrome/browser/ui/history/favicon_view_provider.mm b/ios/chrome/browser/ui/history/favicon_view_provider.mm
index ea2707e9dc595e037eb94c733d0e08dfde6520f1..d96e12664420f080410ef6cbf1e084b208985fc9 100644
--- a/ios/chrome/browser/ui/history/favicon_view_provider.mm
+++ b/ios/chrome/browser/ui/history/favicon_view_provider.mm
@@ -8,7 +8,6 @@
#include "base/ios/weak_nsobject.h"
#include "base/mac/bind_objc_block.h"
#import "base/mac/foundation_util.h"
-#include "base/mac/objc_property_releaser.h"
#include "base/mac/scoped_nsobject.h"
#include "base/memory/ref_counted_memory.h"
#include "base/strings/sys_string_conversions.h"
@@ -24,9 +23,11 @@
#include "skia/ext/skia_utils_ios.h"
#include "url/gurl.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
@interface FaviconViewProvider () {
- // Property releaser for FaviconViewProvider.
- base::mac::ObjCPropertyReleaser _propertyReleaser_FaviconViewProvider;
// Delegate for handling completion of favicon load.
base::WeakNSProtocol<id<FaviconViewProviderDelegate>> _delegate;
// Used to cancel tasks for the LargeIconService.
@@ -38,16 +39,16 @@
// Size to render the favicon.
@property(nonatomic, assign) CGFloat faviconSize;
// Favicon image for the favicon view.
-@property(nonatomic, retain) UIImage* favicon;
+@property(nonatomic, strong) UIImage* favicon;
// Fallback text for the favicon view if there is no appropriately sized
// favicon availabile.
@property(nonatomic, copy) NSString* fallbackText;
// Fallback background color for the favicon view if there is no appropriately
// sized favicon available.
-@property(nonatomic, retain) UIColor* fallbackBackgroundColor;
+@property(nonatomic, strong) UIColor* fallbackBackgroundColor;
// Fallback text color for the favicon view if there is no appropriately
// sized favicon available.
-@property(nonatomic, retain) UIColor* fallbackTextColor;
+@property(nonatomic, strong) UIColor* fallbackTextColor;
// Fetches favicon for |URL| from |faviconService|. Notifies delegate when
// favicon is retrieved.
@@ -73,12 +74,10 @@
delegate:(id<FaviconViewProviderDelegate>)delegate {
self = [super init];
if (self) {
- _propertyReleaser_FaviconViewProvider.Init(self,
- [FaviconViewProvider class]);
_faviconSize = faviconSize;
_delegate.reset(delegate);
- _fallbackBackgroundColor = [[UIColor grayColor] retain];
- _fallbackTextColor = [[UIColor whiteColor] retain];
+ _fallbackBackgroundColor = [UIColor grayColor];
+ _fallbackTextColor = [UIColor whiteColor];
[self fetchFaviconForURL:URL
size:faviconSize
minSize:minFaviconSize
@@ -102,7 +101,7 @@
GURL blockURL(URL);
void (^faviconBlock)(const favicon_base::LargeIconResult&) = ^(
const favicon_base::LargeIconResult& result) {
- base::scoped_nsobject<FaviconViewProvider> strongSelf([weakSelf retain]);
+ base::scoped_nsobject<FaviconViewProvider> strongSelf(weakSelf);
if (!strongSelf)
return;
if (result.bitmap.is_valid()) {
@@ -129,7 +128,7 @@
CGFloat faviconSize = [UIScreen mainScreen].scale * size;
CGFloat minFaviconSize = [UIScreen mainScreen].scale * minSize;
largeIconService->GetLargeIconOrFallbackStyle(
- URL, minFaviconSize, faviconSize, base::BindBlock(faviconBlock),
+ URL, minFaviconSize, faviconSize, base::BindBlockArc(faviconBlock),
&_faviconTaskTracker);
}

Powered by Google App Engine
This is Rietveld 408576698