summaryrefslogtreecommitdiffstats
path: root/chrome/browser/login_prompt.cc
diff options
context:
space:
mode:
authorcbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 00:43:37 +0000
committercbentzel@chromium.org <cbentzel@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-21 00:43:37 +0000
commit2e3e1908a954a3e23ddc08ff7f2023b0d3b92a21 (patch)
treee85cc973147bee79cc4df802d96a00c212883f6b /chrome/browser/login_prompt.cc
parent71fd4a1ba4fcf4ef9ae5d869837b1a681749227d (diff)
downloadchromium_src-2e3e1908a954a3e23ddc08ff7f2023b0d3b92a21.zip
chromium_src-2e3e1908a954a3e23ddc08ff7f2023b0d3b92a21.tar.gz
chromium_src-2e3e1908a954a3e23ddc08ff7f2023b0d3b92a21.tar.bz2
Username+password weren't being saved for HTTP or FTP authentication.
HTTP + FTP authentication reuses the PasswordManager infrastructure for saving and autofilling passwords. When the user needs to be prompted for username + password, a PasswordForm is created. However, a username_element and password_element were never set in the PasswordForm. The PasswordFormManager would then treat this form as invalid, and the values would never be saved even if the page loaded successfully. The UI flow is a bit different from older versions of Chrome, but more consistent with other password saves: the user first presses the OK button to provisionally save and try the new password. When the page loads successfully, an info bar than appears to ask the user whether the password should be saved. BUG=5236 TEST=Go to site (or proxy) which requires Basic or Digest HTTP authentication, enter correct username+password and elect to save the password. Stop Chrome, reopen, and go to site (or through same proxy) and make sure username+password are autofilled in the form. Review URL: http://codereview.chromium.org/3398010 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60000 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/login_prompt.cc')
-rw-r--r--chrome/browser/login_prompt.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/chrome/browser/login_prompt.cc b/chrome/browser/login_prompt.cc
index f8074e0..46194ef 100644
--- a/chrome/browser/login_prompt.cc
+++ b/chrome/browser/login_prompt.cc
@@ -395,6 +395,11 @@ class LoginDialogTask : public Task {
void MakeInputForPasswordManager(
std::vector<PasswordForm>* password_manager_input) {
PasswordForm dialog_form;
+ // username_element and password_element need to be set. The value
+ // for both do not matter, but if they are empty then the username+password
+ // will never be saved.
+ dialog_form.username_element = ASCIIToUTF16("username");
+ dialog_form.password_element = ASCIIToUTF16("password");
if (LowerCaseEqualsASCII(auth_info_->scheme, "basic")) {
dialog_form.scheme = PasswordForm::SCHEME_BASIC;
} else if (LowerCaseEqualsASCII(auth_info_->scheme, "digest")) {