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

Unified Diff: ios/chrome/browser/ui/fancy_ui/tinted_button.mm

Issue 2838213002: [ObjC ARC] Converts ios/chrome/browser/ui/fancy_ui:fancy_ui to ARC. (Closed)
Patch Set: Remove scoped object header Created 3 years, 8 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/fancy_ui/tinted_button.mm
diff --git a/ios/chrome/browser/ui/fancy_ui/tinted_button.mm b/ios/chrome/browser/ui/fancy_ui/tinted_button.mm
index 6df8475d9a34664d8726e560f404f22b3efd30b1..b0c06a608926d0828dde8e096bd77eeb9b319fb9 100644
--- a/ios/chrome/browser/ui/fancy_ui/tinted_button.mm
+++ b/ios/chrome/browser/ui/fancy_ui/tinted_button.mm
@@ -4,11 +4,13 @@
#include "ios/chrome/browser/ui/fancy_ui/tinted_button.h"
-#import "base/mac/scoped_nsobject.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
@interface TintedButton () {
- base::scoped_nsobject<UIColor> normalStateTint_;
- base::scoped_nsobject<UIColor> highlightedTint_;
+ UIColor* normalStateTint_;
+ UIColor* highlightedTint_;
}
// Makes the button's tint color reflect its current state.
@@ -21,10 +23,10 @@
- (void)setTintColor:(UIColor*)color forState:(UIControlState)state {
switch (state) {
case UIControlStateNormal:
- normalStateTint_.reset([color copy]);
+ normalStateTint_ = [color copy];
break;
case UIControlStateHighlighted:
- highlightedTint_.reset([color copy]);
+ highlightedTint_ = [color copy];
break;
default:
return;
@@ -50,13 +52,13 @@
UIColor* newTint = nil;
switch (self.state) {
case UIControlStateNormal:
- newTint = normalStateTint_.get();
+ newTint = normalStateTint_;
break;
case UIControlStateHighlighted:
- newTint = highlightedTint_.get();
+ newTint = highlightedTint_;
break;
default:
- newTint = normalStateTint_.get();
+ newTint = normalStateTint_;
break;
}
self.tintColor = newTint;

Powered by Google App Engine
This is Rietveld 408576698