| Index: chrome/browser/ui/gtk/login_prompt_gtk.cc
|
| diff --git a/chrome/browser/ui/gtk/login_prompt_gtk.cc b/chrome/browser/ui/gtk/login_prompt_gtk.cc
|
| index 72e51bb4e9ae501e2f38f87e4e43e22ef5fc2247..136f75e967ad478a8e766a3db005c3e8eabaa1a5 100644
|
| --- a/chrome/browser/ui/gtk/login_prompt_gtk.cc
|
| +++ b/chrome/browser/ui/gtk/login_prompt_gtk.cc
|
| @@ -41,7 +41,8 @@ class LoginHandlerGtk : public LoginHandler,
|
| : LoginHandler(auth_info, request),
|
| username_entry_(NULL),
|
| password_entry_(NULL),
|
| - ok_(NULL) {
|
| + ok_(NULL),
|
| + dialog_(NULL) {
|
| }
|
|
|
| // LoginModelObserver implementation.
|
| @@ -113,10 +114,16 @@ class LoginHandlerGtk : public LoginHandler,
|
| WebContents* requesting_contents = GetWebContentsForLogin();
|
| DCHECK(requesting_contents);
|
|
|
| - SetDialog(new ConstrainedWindowGtk(requesting_contents, this));
|
| + dialog_ = new ConstrainedWindowGtk(requesting_contents, this);
|
| NotifyAuthNeeded();
|
| }
|
|
|
| + virtual void CloseDialog() OVERRIDE {
|
| + // The hosting WebContentsModalDialog may have been freed.
|
| + if (dialog_)
|
| + dialog_->CloseWebContentsModalDialog();
|
| + }
|
| +
|
| // Overridden from ConstrainedWindowGtkDelegate:
|
| virtual GtkWidget* GetWidgetRoot() OVERRIDE {
|
| return root_.get();
|
| @@ -130,7 +137,7 @@ class LoginHandlerGtk : public LoginHandler,
|
| DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
|
|
|
| // The constrained window is going to delete itself; clear our pointer.
|
| - SetDialog(NULL);
|
| + dialog_ = NULL;
|
| SetModel(NULL);
|
|
|
| ReleaseSoon();
|
| @@ -158,6 +165,8 @@ class LoginHandlerGtk : public LoginHandler,
|
| GtkWidget* password_entry_;
|
| GtkWidget* ok_;
|
|
|
| + ConstrainedWindowGtk* dialog_;
|
| +
|
| DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk);
|
| };
|
|
|
|
|