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

Side by Side Diff: chrome/renderer/form_manager.cc

Issue 3063008: Merge 53350 - AutoFill: Record whether the user initiated the form submission... (Closed) Base URL: svn://svn.chromium.org/chrome/branches/472/src/
Patch Set: Created 10 years, 4 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 | « chrome/common/render_messages.h ('k') | webkit/glue/form_data.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/renderer/form_manager.h" 5 #include "chrome/renderer/form_manager.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "base/scoped_vector.h" 8 #include "base/scoped_vector.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/stl_util-inl.h" 10 #include "base/stl_util-inl.h"
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 if (!frame) 287 if (!frame)
288 return false; 288 return false;
289 289
290 if (requirements & REQUIRE_AUTOCOMPLETE && !element.autoComplete()) 290 if (requirements & REQUIRE_AUTOCOMPLETE && !element.autoComplete())
291 return false; 291 return false;
292 292
293 form->name = element.name(); 293 form->name = element.name();
294 form->method = element.method(); 294 form->method = element.method();
295 form->origin = frame->url(); 295 form->origin = frame->url();
296 form->action = frame->document().completeURL(element.action()); 296 form->action = frame->document().completeURL(element.action());
297 form->user_submitted = element.wasUserSubmitted();
297 298
298 // If the completed URL is not valid, just use the action we get from 299 // If the completed URL is not valid, just use the action we get from
299 // WebKit. 300 // WebKit.
300 if (!form->action.is_valid()) 301 if (!form->action.is_valid())
301 form->action = GURL(element.action()); 302 form->action = GURL(element.action());
302 303
303 // A map from a FormField's name to the FormField itself. 304 // A map from a FormField's name to the FormField itself.
304 std::map<string16, FormField*> name_map; 305 std::map<string16, FormField*> name_map;
305 306
306 // The extracted FormFields. We use pointers so we can store them in 307 // The extracted FormFields. We use pointers so we can store them in
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
856 return; 857 return;
857 858
858 WebInputElement input_element = field->to<WebInputElement>(); 859 WebInputElement input_element = field->to<WebInputElement>();
859 860
860 // If the maxlength attribute contains a negative value, maxLength() 861 // If the maxlength attribute contains a negative value, maxLength()
861 // returns the default maxlength value. 862 // returns the default maxlength value.
862 input_element.setSuggestedValue( 863 input_element.setSuggestedValue(
863 data->value().substr(0, input_element.maxLength())); 864 data->value().substr(0, input_element.maxLength()));
864 input_element.setAutofilled(true); 865 input_element.setAutofilled(true);
865 } 866 }
OLDNEW
« no previous file with comments | « chrome/common/render_messages.h ('k') | webkit/glue/form_data.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698