Skip to content

Commit 6683bf6

Browse files
committed
[GTK] support for login dialog queue
1 parent f4fa8cf commit 6683bf6

File tree

1 file changed

+18
-2
lines changed

1 file changed

+18
-2
lines changed

src/browser/shell_login_dialog_gtk.cc

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,17 +95,25 @@ void ShellLoginDialog::PlatformCreateDialog(const string16& message) {
9595

9696
g_signal_connect(root_, "response", G_CALLBACK(OnResponseThunk), this);
9797
gtk_widget_grab_focus(username_entry_);
98-
gtk_widget_show_all(GTK_WIDGET(root_));
9998
}
10099

101100
void ShellLoginDialog::PlatformCleanUp() {
102101
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
102+
if (root_) {
103+
gtk_widget_destroy(root_);
104+
root_ = NULL;
105+
}
103106
}
104107

105108
void ShellLoginDialog::PlatformRequestCancelled() {
106109
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
107110
}
108111

112+
void ShellLoginDialog::PlatformShowDialog() {
113+
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
114+
gtk_widget_show_all(GTK_WIDGET(root_));
115+
}
116+
109117
void ShellLoginDialog::OnResponse(GtkWidget* sender, int response_id) {
110118
switch (response_id) {
111119
case GTK_RESPONSE_OK:
@@ -121,7 +129,15 @@ void ShellLoginDialog::OnResponse(GtkWidget* sender, int response_id) {
121129
NOTREACHED();
122130
}
123131

124-
gtk_widget_destroy(root_);
132+
}
133+
134+
void ShellLoginDialog::OnDestroy(GtkWidget* widget) {
135+
DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
136+
137+
// The web contents modal dialog is going to delete itself; clear our pointer.
138+
root_ = NULL;
139+
140+
ReleaseSoon();
125141
}
126142

127143
} // namespace content

0 commit comments

Comments
 (0)