@@ -80,11 +80,14 @@ - (void)focus {
8080- (void )alertDidEnd : (NSAlert *)alert
8181 returnCode : (int )returnCode
8282 contextInfo : (void *)contextInfo {
83- if (returnCode == NSRunStoppedResponse )
84- return ;
8583
8684 content::ShellLoginDialog* this_dialog =
8785 reinterpret_cast <content::ShellLoginDialog*>(contextInfo);
86+ if (returnCode == NSRunStoppedResponse ) {
87+ this_dialog->ReleaseSoon ();
88+ return ;
89+ }
90+
8891 if (returnCode == NSAlertFirstButtonReturn ) {
8992 this_dialog->UserAcceptedAuth (
9093 base::SysNSStringToUTF16 ([usernameField_ stringValue ]),
@@ -106,11 +109,14 @@ - (void)cancel {
106109void ShellLoginDialog::PlatformCreateDialog (const string16& message) {
107110 DCHECK (BrowserThread::CurrentlyOn (BrowserThread::UI));
108111 helper_ = [[ShellLoginDialogHelper alloc ] init ];
112+ message_ = message;
113+ }
109114
115+ void ShellLoginDialog::PlatformShowDialog () {
110116 // Show the modal dialog.
111117 NSAlert * alert = [helper_ alert ];
112118 [alert setDelegate: helper_];
113- [alert setInformativeText: base: :SysUTF16ToNSString (message )];
119+ [alert setInformativeText: base: :SysUTF16ToNSString (message_ )];
114120 [alert setMessageText: @" Please log in." ];
115121 [alert addButtonWithTitle: @" OK" ];
116122 NSButton * other = [alert addButtonWithTitle: @" Cancel" ];
0 commit comments