@@ -80,11 +80,14 @@ - (void)focus {
80
80
- (void )alertDidEnd : (NSAlert *)alert
81
81
returnCode : (int )returnCode
82
82
contextInfo : (void *)contextInfo {
83
- if (returnCode == NSRunStoppedResponse )
84
- return ;
85
83
86
84
content::ShellLoginDialog* this_dialog =
87
85
reinterpret_cast <content::ShellLoginDialog*>(contextInfo);
86
+ if (returnCode == NSRunStoppedResponse ) {
87
+ this_dialog->ReleaseSoon ();
88
+ return ;
89
+ }
90
+
88
91
if (returnCode == NSAlertFirstButtonReturn ) {
89
92
this_dialog->UserAcceptedAuth (
90
93
base::SysNSStringToUTF16 ([usernameField_ stringValue ]),
@@ -106,11 +109,14 @@ - (void)cancel {
106
109
void ShellLoginDialog::PlatformCreateDialog (const string16& message) {
107
110
DCHECK (BrowserThread::CurrentlyOn (BrowserThread::UI));
108
111
helper_ = [[ShellLoginDialogHelper alloc ] init ];
112
+ message_ = message;
113
+ }
109
114
115
+ void ShellLoginDialog::PlatformShowDialog () {
110
116
// Show the modal dialog.
111
117
NSAlert * alert = [helper_ alert ];
112
118
[alert setDelegate: helper_];
113
- [alert setInformativeText: base: :SysUTF16ToNSString (message )];
119
+ [alert setInformativeText: base: :SysUTF16ToNSString (message_ )];
114
120
[alert setMessageText: @" Please log in." ];
115
121
[alert addButtonWithTitle: @" OK" ];
116
122
NSButton * other = [alert addButtonWithTitle: @" Cancel" ];
0 commit comments