Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3112)

Unified Diff: chrome/browser/ui/gtk/login_prompt_gtk.cc

Issue 12276010: Factor out uses of the WebContentsModalDialog interface from platform-independent code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: remove incorrect override Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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);
};
« no previous file with comments | « chrome/browser/ui/gtk/constrained_web_dialog_delegate_gtk.cc ('k') | chrome/browser/ui/gtk/tab_modal_confirm_dialog_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698