Index: chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm |
diff --git a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm |
index be7b5e430aabd9d5689b14f6d5179d00cebd30c5..2570c7642a6d297daeb3ebd339a739ee1232e049 100644 |
--- a/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm |
+++ b/chrome/browser/ui/cocoa/js_modal_dialog_cocoa.mm |
@@ -20,13 +20,13 @@ |
// going away. Is responsible for cleaning itself up. |
@interface JavaScriptAppModalDialogHelper : NSObject<NSAlertDelegate> { |
@private |
- NSAlert* alert_; |
+ scoped_nsobject<NSAlert> alert_; |
NSTextField* textField_; // WEAK; owned by alert_ |
} |
- (NSAlert*)alert; |
- (NSTextField*)textField; |
-- (void)alertDidEnd:(NSAlert *)alert |
+- (void)alertDidEnd:(NSAlert*)alert |
returnCode:(int)returnCode |
contextInfo:(void*)contextInfo; |
@@ -35,7 +35,7 @@ |
@implementation JavaScriptAppModalDialogHelper |
- (NSAlert*)alert { |
- alert_ = [[NSAlert alloc] init]; |
+ alert_.reset([[NSAlert alloc] init]); |
return alert_; |
} |
@@ -48,11 +48,6 @@ |
return textField_; |
} |
-- (void)dealloc { |
- [alert_ release]; |
- [super dealloc]; |
-} |
- |
// |contextInfo| is the JSModalDialogCocoa that owns us. |
- (void)alertDidEnd:(NSAlert*)alert |
returnCode:(int)returnCode |
@@ -90,6 +85,7 @@ |
} |
} |
} |
+ |
@end |
//////////////////////////////////////////////////////////////////////////////// |