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