| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 strippedURL.setUser(String()); | 104 strippedURL.setUser(String()); |
| 105 strippedURL.setPass(String()); | 105 strippedURL.setPass(String()); |
| 106 strippedURL.setQuery(String()); | 106 strippedURL.setQuery(String()); |
| 107 strippedURL.setFragmentIdentifier(String()); | 107 strippedURL.setFragmentIdentifier(String()); |
| 108 return strippedURL; | 108 return strippedURL; |
| 109 } | 109 } |
| 110 | 110 |
| 111 // Helper to gather up the final form data and create a PasswordForm. | 111 // Helper to gather up the final form data and create a PasswordForm. |
| 112 void assemblePasswordFormResult(const KURL& fullOrigin, | 112 void assemblePasswordFormResult(const KURL& fullOrigin, |
| 113 const KURL& fullAction, | 113 const KURL& fullAction, |
| 114 HTMLFormControlElement* submit, | 114 Handle<HTMLFormControlElement> submit, |
| 115 HTMLInputElement* userName, | 115 Handle<HTMLInputElement> userName, |
| 116 const Vector<String>& alternateUserNames, | 116 const Vector<String>& alternateUserNames, |
| 117 HTMLInputElement* oldPassword, | 117 Handle<HTMLInputElement> oldPassword, |
| 118 HTMLInputElement* password, | 118 Handle<HTMLInputElement> password, |
| 119 WebPasswordFormData* result) | 119 WebPasswordFormData* result) |
| 120 { | 120 { |
| 121 // We want to keep the path but strip any authentication data, as well as | 121 // We want to keep the path but strip any authentication data, as well as |
| 122 // query and ref portions of URL, for the form action and form origin. | 122 // query and ref portions of URL, for the form action and form origin. |
| 123 result->action = stripURL(fullAction); | 123 result->action = stripURL(fullAction); |
| 124 result->origin = stripURL(fullOrigin); | 124 result->origin = stripURL(fullOrigin); |
| 125 | 125 |
| 126 // Naming is confusing here because we have both the HTML form origin URL | 126 // Naming is confusing here because we have both the HTML form origin URL |
| 127 // the page where the form was seen), and the "origin" components of the url | 127 // the page where the form was seen), and the "origin" components of the url |
| 128 // (scheme, host, and port). | 128 // (scheme, host, and port). |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 // FIXME(oilpan): Remove Handle<>(). |
| 176 assemblePasswordFormResult(fullOrigin, fullAction, | 177 assemblePasswordFormResult(fullOrigin, fullAction, |
| 177 fields.submit, fields.userName, | 178 Handle<HTMLFormControlElement>(fields.submit), |
| 178 fields.alternateUserNames, | 179 Handle<HTMLInputElement>(fields.userName), |
| 179 oldPassword, password, this); | 180 fields.alternateUserNames, |
| 181 Handle<HTMLInputElement>(oldPassword), |
| 182 Handle<HTMLInputElement>(password), |
| 183 this); |
| 180 } | 184 } |
| 181 | 185 |
| 182 } // namespace WebKit | 186 } // namespace WebKit |
| OLD | NEW |