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

Unified Diff: ios/chrome/browser/passwords/password_generation_offer_view.mm

Issue 2933873002: [ObjC ARC] Converts ios/chrome/browser/passwords:passwords to ARC. (Closed)
Patch Set: fix names and nil assignments. Created 3 years, 6 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/passwords/password_generation_offer_view.mm
diff --git a/ios/chrome/browser/passwords/password_generation_offer_view.mm b/ios/chrome/browser/passwords/password_generation_offer_view.mm
index 5c59c779c546612a842a667658bcb339bf3a866c..a74d855e5ed9d479ad2e56d818f1e23c8688073c 100644
--- a/ios/chrome/browser/passwords/password_generation_offer_view.mm
+++ b/ios/chrome/browser/passwords/password_generation_offer_view.mm
@@ -5,12 +5,15 @@
#import "ios/chrome/browser/passwords/password_generation_offer_view.h"
#include "base/i18n/rtl.h"
-#include "base/mac/scoped_nsobject.h"
#include "ios/chrome/browser/passwords/password_generation_utils.h"
#import "ios/chrome/browser/ui/uikit_ui_util.h"
#include "ios/chrome/grit/ios_strings.h"
#include "ui/base/l10n/l10n_util.h"
+#if !defined(__has_feature) || !__has_feature(objc_arc)
+#error "This file requires ARC support."
+#endif
+
namespace {
// Constants for the offer view.
const int kOfferLabelColor = 0x007AFF;
@@ -24,7 +27,7 @@ const CGFloat kOfferLabelFontSize = 15.0;
const CGRect defaultFrame = CGRectMake(0, 0, 100, 100);
self = [super initWithFrame:defaultFrame];
if (self) {
- base::scoped_nsobject<UILabel> label([[UILabel alloc] init]);
+ UILabel* label = [[UILabel alloc] init];
[label setText:l10n_util::GetNSString(IDS_IOS_GENERATE_PASSWORD_LABEL)];
UIFont* font = [UIFont systemFontOfSize:kOfferLabelFontSize];
[label setFont:font];
@@ -41,8 +44,7 @@ const CGFloat kOfferLabelFontSize = 15.0;
[self addSubview:label];
// Invisible button for tap recognition.
- base::scoped_nsobject<UIButton> button(
- [[UIButton alloc] initWithFrame:[self bounds]]);
+ UIButton* button = [[UIButton alloc] initWithFrame:[self bounds]];
[button setBackgroundColor:[UIColor clearColor]];
[button setAutoresizingMask:UIViewAutoresizingFlexibleWidth |
UIViewAutoresizingFlexibleHeight];

Powered by Google App Engine
This is Rietveld 408576698