| 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 <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 400 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 411 } | 411 } |
| 412 | 412 |
| 413 // Helper to create a PasswordForm and stuff it into a vector as input | 413 // Helper to create a PasswordForm and stuff it into a vector as input |
| 414 // for PasswordManager::PasswordFormsParsed, the hook into PasswordManager. | 414 // for PasswordManager::PasswordFormsParsed, the hook into PasswordManager. |
| 415 void MakeInputForPasswordManager( | 415 void MakeInputForPasswordManager( |
| 416 const GURL& request_url, | 416 const GURL& request_url, |
| 417 net::AuthChallengeInfo* auth_info, | 417 net::AuthChallengeInfo* auth_info, |
| 418 LoginHandler* handler, | 418 LoginHandler* handler, |
| 419 std::vector<PasswordForm>* password_manager_input) { | 419 std::vector<PasswordForm>* password_manager_input) { |
| 420 PasswordForm dialog_form; | 420 PasswordForm dialog_form; |
| 421 if (LowerCaseEqualsASCII(auth_info->scheme, "basic")) { | 421 if (base::LowerCaseEqualsASCII(auth_info->scheme, "basic")) { |
| 422 dialog_form.scheme = PasswordForm::SCHEME_BASIC; | 422 dialog_form.scheme = PasswordForm::SCHEME_BASIC; |
| 423 } else if (LowerCaseEqualsASCII(auth_info->scheme, "digest")) { | 423 } else if (base::LowerCaseEqualsASCII(auth_info->scheme, "digest")) { |
| 424 dialog_form.scheme = PasswordForm::SCHEME_DIGEST; | 424 dialog_form.scheme = PasswordForm::SCHEME_DIGEST; |
| 425 } else { | 425 } else { |
| 426 dialog_form.scheme = PasswordForm::SCHEME_OTHER; | 426 dialog_form.scheme = PasswordForm::SCHEME_OTHER; |
| 427 } | 427 } |
| 428 std::string host_and_port(auth_info->challenger.ToString()); | 428 std::string host_and_port(auth_info->challenger.ToString()); |
| 429 if (auth_info->is_proxy) { | 429 if (auth_info->is_proxy) { |
| 430 std::string origin = host_and_port; | 430 std::string origin = host_and_port; |
| 431 // We don't expect this to already start with http:// or https://. | 431 // We don't expect this to already start with http:// or https://. |
| 432 DCHECK(origin.find("http://") != 0 && origin.find("https://") != 0); | 432 DCHECK(origin.find("http://") != 0 && origin.find("https://") != 0); |
| 433 origin = std::string("http://") + origin; | 433 origin = std::string("http://") + origin; |
| (...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 net::URLRequest* request) { | 535 net::URLRequest* request) { |
| 536 bool is_main_frame = (request->load_flags() & net::LOAD_MAIN_FRAME) != 0; | 536 bool is_main_frame = (request->load_flags() & net::LOAD_MAIN_FRAME) != 0; |
| 537 LoginHandler* handler = LoginHandler::Create(auth_info, request); | 537 LoginHandler* handler = LoginHandler::Create(auth_info, request); |
| 538 BrowserThread::PostTask( | 538 BrowserThread::PostTask( |
| 539 BrowserThread::UI, FROM_HERE, | 539 BrowserThread::UI, FROM_HERE, |
| 540 base::Bind(&LoginDialogCallback, request->url(), | 540 base::Bind(&LoginDialogCallback, request->url(), |
| 541 make_scoped_refptr(auth_info), make_scoped_refptr(handler), | 541 make_scoped_refptr(auth_info), make_scoped_refptr(handler), |
| 542 is_main_frame)); | 542 is_main_frame)); |
| 543 return handler; | 543 return handler; |
| 544 } | 544 } |
| OLD | NEW |