| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/login/login_prompt.h" | 5 #include "chrome/browser/ui/login/login_prompt.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
| 11 #include "chrome/browser/password_manager/password_manager.h" | 11 #include "chrome/browser/password_manager/password_manager.h" |
| 12 #include "chrome/browser/tab_contents/tab_util.h" | 12 #include "chrome/browser/tab_contents/tab_util.h" |
| 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" | 13 #include "chrome/browser/ui/gtk/constrained_window_gtk.h" |
| 14 #include "chrome/browser/ui/gtk/gtk_util.h" | 14 #include "chrome/browser/ui/gtk/gtk_util.h" |
| 15 #include "chrome/browser/ui/login/login_model.h" | 15 #include "chrome/browser/ui/login/login_model.h" |
| 16 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" | 16 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 17 #include "content/public/browser/browser_thread.h" | 17 #include "content/public/browser/browser_thread.h" |
| 18 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
| 19 #include "content/public/browser/web_contents_delegate.h" | 19 #include "content/public/browser/web_contents_delegate.h" |
| 20 #include "grit/generated_resources.h" | 20 #include "grit/generated_resources.h" |
| 21 #include "net/url_request/url_request.h" | 21 #include "net/url_request/url_request.h" |
| 22 #include "ui/base/gtk/gtk_compat.h" | 22 #include "ui/base/gtk/gtk_compat.h" |
| 23 #include "ui/base/gtk/gtk_hig_constants.h" | 23 #include "ui/base/gtk/gtk_hig_constants.h" |
| 24 #include "ui/base/gtk/gtk_signal.h" | 24 #include "ui/base/gtk/gtk_signal.h" |
| 25 #include "ui/base/gtk/scoped_gobject.h" | 25 #include "ui/base/gtk/scoped_gobject.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 | 27 |
| 28 using content::BrowserThread; | 28 using content::BrowserThread; |
| 29 using content::PasswordForm; | 29 using content::PasswordForm; |
| 30 using content::WebContents; | 30 using content::WebContents; |
| 31 using web_modal::WebContentsModalDialogManager; |
| 31 | 32 |
| 32 // ---------------------------------------------------------------------------- | 33 // ---------------------------------------------------------------------------- |
| 33 // LoginHandlerGtk | 34 // LoginHandlerGtk |
| 34 | 35 |
| 35 // This class simply forwards the authentication from the LoginView (on | 36 // This class simply forwards the authentication from the LoginView (on |
| 36 // the UI thread) to the net::URLRequest (on the I/O thread). | 37 // the UI thread) to the net::URLRequest (on the I/O thread). |
| 37 // This class uses ref counting to ensure that it lives until all InvokeLaters | 38 // This class uses ref counting to ensure that it lives until all InvokeLaters |
| 38 // have been called. | 39 // have been called. |
| 39 class LoginHandlerGtk : public LoginHandler { | 40 class LoginHandlerGtk : public LoginHandler { |
| 40 public: | 41 public: |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 | 193 |
| 193 void LoginHandlerGtk::OnDestroy(GtkWidget* widget) { | 194 void LoginHandlerGtk::OnDestroy(GtkWidget* widget) { |
| 194 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 195 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 195 | 196 |
| 196 // The web contents modal dialog is going to delete itself; clear our pointer. | 197 // The web contents modal dialog is going to delete itself; clear our pointer. |
| 197 dialog_ = NULL; | 198 dialog_ = NULL; |
| 198 SetModel(NULL); | 199 SetModel(NULL); |
| 199 | 200 |
| 200 ReleaseSoon(); | 201 ReleaseSoon(); |
| 201 } | 202 } |
| OLD | NEW |