Chromium Code Reviews| 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 442 // not hosted by a tab (e.g. an extension). Cancel just in case | 442 // not hosted by a tab (e.g. an extension). Cancel just in case |
| 443 // (cancelling twice is a no-op). | 443 // (cancelling twice is a no-op). |
| 444 handler->CancelAuth(); | 444 handler->CancelAuth(); |
| 445 return; | 445 return; |
| 446 } | 446 } |
| 447 | 447 |
| 448 // Tell the password manager to look for saved passwords. | 448 // Tell the password manager to look for saved passwords. |
| 449 TabContentsWrapper* wrapper = | 449 TabContentsWrapper* wrapper = |
| 450 TabContentsWrapper::GetCurrentWrapperForContents(parent_contents); | 450 TabContentsWrapper::GetCurrentWrapperForContents(parent_contents); |
| 451 if (!wrapper) | 451 if (!wrapper) |
| 452 NOTREACHED() << "Login dialog created for TabContents with no wrapper"; | 452 return; |
|
mattm
2011/11/30 23:15:28
So if we think this is an expected behavior, shoul
James Hawkins
2011/12/01 21:37:15
Done.
| |
| 453 | 453 |
| 454 PasswordManager* password_manager = wrapper->password_manager(); | 454 PasswordManager* password_manager = wrapper->password_manager(); |
| 455 std::vector<PasswordForm> v; | 455 std::vector<PasswordForm> v; |
| 456 MakeInputForPasswordManager(request_url, auth_info, handler, &v); | 456 MakeInputForPasswordManager(request_url, auth_info, handler, &v); |
| 457 password_manager->OnPasswordFormsFound(v); | 457 password_manager->OnPasswordFormsFound(v); |
| 458 handler->SetPasswordManager(password_manager); | 458 handler->SetPasswordManager(password_manager); |
| 459 | 459 |
| 460 // The realm is controlled by the remote server, so there is no reason | 460 // The realm is controlled by the remote server, so there is no reason |
| 461 // to believe it is of a reasonable length. | 461 // to believe it is of a reasonable length. |
| 462 string16 elided_realm; | 462 string16 elided_realm; |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 477 | 477 |
| 478 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, | 478 LoginHandler* CreateLoginPrompt(net::AuthChallengeInfo* auth_info, |
| 479 net::URLRequest* request) { | 479 net::URLRequest* request) { |
| 480 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 480 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
| 481 BrowserThread::PostTask( | 481 BrowserThread::PostTask( |
| 482 BrowserThread::UI, FROM_HERE, | 482 BrowserThread::UI, FROM_HERE, |
| 483 base::Bind(&LoginDialogCallback, request->url(), | 483 base::Bind(&LoginDialogCallback, request->url(), |
| 484 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); | 484 make_scoped_refptr(auth_info), make_scoped_refptr(handler))); |
| 485 return handler; | 485 return handler; |
| 486 } | 486 } |
| OLD | NEW |