| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/login_prompt.h" | 5 #include "chrome/browser/login_prompt.h" |
| 6 | 6 |
| 7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "chrome/browser/chrome_thread.h" | 10 #include "chrome/browser/chrome_thread.h" |
| (...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 } | 175 } |
| 176 | 176 |
| 177 virtual void CancelAuth() { | 177 virtual void CancelAuth() { |
| 178 if (WasAuthHandled(true)) | 178 if (WasAuthHandled(true)) |
| 179 return; | 179 return; |
| 180 | 180 |
| 181 ChromeThread::PostTask( | 181 ChromeThread::PostTask( |
| 182 ChromeThread::UI, FROM_HERE, | 182 ChromeThread::UI, FROM_HERE, |
| 183 NewRunnableMethod(this, &LoginHandlerGtk::CloseContentsDeferred)); | 183 NewRunnableMethod(this, &LoginHandlerGtk::CloseContentsDeferred)); |
| 184 ChromeThread::PostTask( | 184 ChromeThread::PostTask( |
| 185 ChromeThread::UI, FROM_HERE, | 185 ChromeThread::UI, FROM_HERE, |
| 186 NewRunnableMethod(this, &LoginHandlerGtk::SendNotifications)); | 186 NewRunnableMethod(this, &LoginHandlerGtk::SendNotifications)); |
| 187 ChromeThread::PostTask( | 187 ChromeThread::PostTask( |
| 188 ChromeThread::IO, FROM_HERE, | 188 ChromeThread::IO, FROM_HERE, |
| 189 NewRunnableMethod(this, &LoginHandlerGtk::CancelAuthDeferred)); | 189 NewRunnableMethod(this, &LoginHandlerGtk::CancelAuthDeferred)); |
| 190 } | 190 } |
| 191 | 191 |
| 192 virtual void OnRequestCancelled() { | 192 virtual void OnRequestCancelled() { |
| 193 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)) << | 193 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)) << |
| 194 "Why is OnRequestCancelled called from the UI thread?"; | 194 "Why is OnRequestCancelled called from the UI thread?"; |
| 195 | 195 |
| 196 // Reference is no longer valid. | 196 // Reference is no longer valid. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 208 virtual void DeleteDelegate() { | 208 virtual void DeleteDelegate() { |
| 209 if (!WasAuthHandled(true)) { | 209 if (!WasAuthHandled(true)) { |
| 210 ChromeThread::PostTask( | 210 ChromeThread::PostTask( |
| 211 ChromeThread::IO, FROM_HERE, | 211 ChromeThread::IO, FROM_HERE, |
| 212 NewRunnableMethod(this, &LoginHandlerGtk::CancelAuthDeferred)); | 212 NewRunnableMethod(this, &LoginHandlerGtk::CancelAuthDeferred)); |
| 213 ChromeThread::PostTask( | 213 ChromeThread::PostTask( |
| 214 ChromeThread::UI, FROM_HERE, | 214 ChromeThread::UI, FROM_HERE, |
| 215 NewRunnableMethod(this, &LoginHandlerGtk::SendNotifications)); | 215 NewRunnableMethod(this, &LoginHandlerGtk::SendNotifications)); |
| 216 } | 216 } |
| 217 | 217 |
| 218 // The constrained window is going to delete itself; clear our pointer. |
| 219 dialog_ = NULL; |
| 218 SetModel(NULL); | 220 SetModel(NULL); |
| 219 | 221 |
| 220 // Delete this object once all InvokeLaters have been called. | 222 // Delete this object once all InvokeLaters have been called. |
| 221 ChromeThread::ReleaseSoon(ChromeThread::IO, FROM_HERE, this); | 223 ChromeThread::ReleaseSoon(ChromeThread::IO, FROM_HERE, this); |
| 222 } | 224 } |
| 223 | 225 |
| 224 private: | 226 private: |
| 225 friend class LoginPrompt; | 227 friend class LoginPrompt; |
| 226 | 228 |
| 227 // Calls SetAuth from the IO loop. | 229 // Calls SetAuth from the IO loop. |
| (...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 342 // so it doesn't try and access this when its too late. | 344 // so it doesn't try and access this when its too late. |
| 343 LoginModel* login_model_; | 345 LoginModel* login_model_; |
| 344 | 346 |
| 345 DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk); | 347 DISALLOW_COPY_AND_ASSIGN(LoginHandlerGtk); |
| 346 }; | 348 }; |
| 347 | 349 |
| 348 // static | 350 // static |
| 349 LoginHandler* LoginHandler::Create(URLRequest* request) { | 351 LoginHandler* LoginHandler::Create(URLRequest* request) { |
| 350 return new LoginHandlerGtk(request); | 352 return new LoginHandlerGtk(request); |
| 351 } | 353 } |
| OLD | NEW |