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

Side by Side Diff: chrome/renderer/autofill/autofill_agent.cc

Issue 7718019: Remove dead WebKit Autofill code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 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 | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/autofill/autofill_agent.h" 5 #include "chrome/renderer/autofill/autofill_agent.h"
6 6
7 #include "base/message_loop.h" 7 #include "base/message_loop.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/common/autofill_messages.h" 9 #include "chrome/common/autofill_messages.h"
10 #include "chrome/common/chrome_constants.h" 10 #include "chrome/common/chrome_constants.h"
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
134 index == static_cast<unsigned>(suggestions_clear_index_)) { 134 index == static_cast<unsigned>(suggestions_clear_index_)) {
135 // User selected 'Clear form'. 135 // User selected 'Clear form'.
136 form_manager_.ClearFormWithNode(node); 136 form_manager_.ClearFormWithNode(node);
137 } else if (!unique_id) { 137 } else if (!unique_id) {
138 // User selected an Autocomplete entry, so we fill directly. 138 // User selected an Autocomplete entry, so we fill directly.
139 WebInputElement element = node.toConst<WebInputElement>(); 139 WebInputElement element = node.toConst<WebInputElement>();
140 140
141 string16 substring = value; 141 string16 substring = value;
142 substring = substring.substr(0, element.maxLength()); 142 substring = substring.substr(0, element.maxLength());
143 element.setValue(substring, true); 143 element.setValue(substring, true);
144
145 WebFrame* webframe = node.document().frame();
146 if (webframe)
147 webframe->notifiyPasswordListenerOfAutocomplete(element);
148 } else { 144 } else {
149 // Fill the values for the whole form. 145 // Fill the values for the whole form.
150 FillAutofillFormData(node, unique_id, AUTOFILL_FILL); 146 FillAutofillFormData(node, unique_id, AUTOFILL_FILL);
151 } 147 }
152 148
153 suggestions_clear_index_ = -1; 149 suggestions_clear_index_ = -1;
154 suggestions_options_index_ = -1; 150 suggestions_options_index_ = -1;
155 } 151 }
156 152
157 void AutofillAgent::didSelectAutofillSuggestion(const WebNode& node, 153 void AutofillAgent::didSelectAutofillSuggestion(const WebNode& node,
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
411 // WebFormControlElementToFormField does not scrape the DOM for the field 407 // WebFormControlElementToFormField does not scrape the DOM for the field
412 // label, so find the label here. 408 // label, so find the label here.
413 // TODO(isherman): Add form and field identities so we can use the cached form 409 // TODO(isherman): Add form and field identities so we can use the cached form
414 // data in FormManager. 410 // data in FormManager.
415 field->label = FormManager::LabelForElement(element); 411 field->label = FormManager::LabelForElement(element);
416 412
417 return true; 413 return true;
418 } 414 }
419 415
420 } // namespace autofill 416 } // namespace autofill
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698