OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2009 Google Inc. All rights reserved. | 2 * Copyright (C) 2009 Google Inc. All rights reserved. |
3 * | 3 * |
4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
5 * modification, are permitted provided that the following conditions are | 5 * modification, are permitted provided that the following conditions are |
6 * met: | 6 * met: |
7 * | 7 * |
8 * * Redistributions of source code must retain the above copyright | 8 * * Redistributions of source code must retain the above copyright |
9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
10 * * Redistributions in binary form must reproduce the above | 10 * * Redistributions in binary form must reproduce the above |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
150 | 150 |
151 } // namespace | 151 } // namespace |
152 | 152 |
153 WebPasswordFormData::WebPasswordFormData(const WebFormElement& webForm) | 153 WebPasswordFormData::WebPasswordFormData(const WebFormElement& webForm) |
154 { | 154 { |
155 RefPtr<HTMLFormElement> form = webForm.operator PassRefPtr<HTMLFormElement>(
); | 155 RefPtr<HTMLFormElement> form = webForm.operator PassRefPtr<HTMLFormElement>(
); |
156 PasswordFormFields fields; | 156 PasswordFormFields fields; |
157 findPasswordFormFields(form.get(), &fields); | 157 findPasswordFormFields(form.get(), &fields); |
158 | 158 |
159 // Get the document URL | 159 // Get the document URL |
160 KURL fullOrigin(ParsedURLString, form->document()->documentURI()); | 160 KURL fullOrigin(ParsedURLString, form->document().documentURI()); |
161 | 161 |
162 // Calculate the canonical action URL | 162 // Calculate the canonical action URL |
163 String action = form->action(); | 163 String action = form->action(); |
164 if (action.isNull()) | 164 if (action.isNull()) |
165 action = ""; // missing 'action' attribute implies current URL | 165 action = ""; // missing 'action' attribute implies current URL |
166 KURL fullAction = form->document()->completeURL(action); | 166 KURL fullAction = form->document().completeURL(action); |
167 if (!fullAction.isValid()) | 167 if (!fullAction.isValid()) |
168 return; | 168 return; |
169 | 169 |
170 // Determine the types of the password fields | 170 // Determine the types of the password fields |
171 HTMLInputElement* password = 0; | 171 HTMLInputElement* password = 0; |
172 HTMLInputElement* oldPassword = 0; | 172 HTMLInputElement* oldPassword = 0; |
173 if (!locateSpecificPasswords(&fields, &password, &oldPassword)) | 173 if (!locateSpecificPasswords(&fields, &password, &oldPassword)) |
174 return; | 174 return; |
175 | 175 |
176 assemblePasswordFormResult(fullOrigin, fullAction, | 176 assemblePasswordFormResult(fullOrigin, fullAction, |
177 fields.submit, fields.userName, | 177 fields.submit, fields.userName, |
178 fields.alternateUserNames, | 178 fields.alternateUserNames, |
179 oldPassword, password, this); | 179 oldPassword, password, this); |
180 } | 180 } |
181 | 181 |
182 } // namespace WebKit | 182 } // namespace WebKit |
OLD | NEW |