Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: Source/web/WebPasswordFormData.cpp

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « Source/web/WebPageSerializer.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « Source/web/WebPageSerializer.cpp ('k') | Source/web/WebPluginContainerImpl.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698