| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/synchronization/lock.h" | 10 #include "base/synchronization/lock.h" |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 353 handled_auth_ = true; | 353 handled_auth_ = true; |
| 354 return was_handled; | 354 return was_handled; |
| 355 } | 355 } |
| 356 | 356 |
| 357 // Calls SetAuth from the IO loop. | 357 // Calls SetAuth from the IO loop. |
| 358 void LoginHandler::SetAuthDeferred(const string16& username, | 358 void LoginHandler::SetAuthDeferred(const string16& username, |
| 359 const string16& password) { | 359 const string16& password) { |
| 360 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 360 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 361 | 361 |
| 362 if (request_) { | 362 if (request_) { |
| 363 request_->SetAuth(username, password); | 363 request_->SetAuth(net::AuthCredentials(username, password)); |
| 364 ResetLoginHandlerForRequest(request_); | 364 ResetLoginHandlerForRequest(request_); |
| 365 } | 365 } |
| 366 } | 366 } |
| 367 | 367 |
| 368 // Calls CancelAuth from the IO loop. | 368 // Calls CancelAuth from the IO loop. |
| 369 void LoginHandler::CancelAuthDeferred() { | 369 void LoginHandler::CancelAuthDeferred() { |
| 370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 370 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 371 | 371 |
| 372 if (request_) { | 372 if (request_) { |
| 373 request_->CancelAuth(); | 373 request_->CancelAuth(); |
| (...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 490 // Public API | 490 // Public API |
| 491 | 491 |
| 492 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 492 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
| 493 net::URLRequest* request) { | 493 net::URLRequest* request) { |
| 494 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 494 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
| 495 BrowserThread::PostTask( | 495 BrowserThread::PostTask( |
| 496 BrowserThread::UI, FROM_HERE, new LoginDialogTask( | 496 BrowserThread::UI, FROM_HERE, new LoginDialogTask( |
| 497 request->url(), auth_info, handler)); | 497 request->url(), auth_info, handler)); |
| 498 return handler; | 498 return handler; |
| 499 } | 499 } |
| OLD | NEW |