| 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 <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 handled_auth_ = true; | 312 handled_auth_ = true; |
| 313 return was_handled; | 313 return was_handled; |
| 314 } | 314 } |
| 315 | 315 |
| 316 // Calls SetAuth from the IO loop. | 316 // Calls SetAuth from the IO loop. |
| 317 void LoginHandler::SetAuthDeferred(const std::wstring& username, | 317 void LoginHandler::SetAuthDeferred(const std::wstring& username, |
| 318 const std::wstring& password) { | 318 const std::wstring& password) { |
| 319 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 319 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 320 | 320 |
| 321 if (request_) { | 321 if (request_) { |
| 322 request_->SetAuth(username, password); | 322 request_->SetAuth(WideToUTF16Hack(username), WideToUTF16Hack(password)); |
| 323 ResetLoginHandlerForRequest(request_); | 323 ResetLoginHandlerForRequest(request_); |
| 324 } | 324 } |
| 325 } | 325 } |
| 326 | 326 |
| 327 // Calls CancelAuth from the IO loop. | 327 // Calls CancelAuth from the IO loop. |
| 328 void LoginHandler::CancelAuthDeferred() { | 328 void LoginHandler::CancelAuthDeferred() { |
| 329 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); | 329 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::IO)); |
| 330 | 330 |
| 331 if (request_) { | 331 if (request_) { |
| 332 request_->CancelAuth(); | 332 request_->CancelAuth(); |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 435 // Public API | 435 // Public API |
| 436 | 436 |
| 437 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 437 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
| 438 URLRequest* request) { | 438 URLRequest* request) { |
| 439 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 439 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
| 440 ChromeThread::PostTask( | 440 ChromeThread::PostTask( |
| 441 ChromeThread::UI, FROM_HERE, new LoginDialogTask( | 441 ChromeThread::UI, FROM_HERE, new LoginDialogTask( |
| 442 request->url(), auth_info, handler)); | 442 request->url(), auth_info, handler)); |
| 443 return handler; | 443 return handler; |
| 444 } | 444 } |
| OLD | NEW |