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

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

Issue 10795007: Fire the onchange event when autocompleting usernames for password forms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 5 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/password_autofill_manager.h" 5 #include "chrome/renderer/autofill/password_autofill_manager.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/common/autofill_messages.h" 10 #include "chrome/common/autofill_messages.h"
(...skipping 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 bool PasswordAutofillManager::DidAcceptAutofillSuggestion( 307 bool PasswordAutofillManager::DidAcceptAutofillSuggestion(
308 const WebKit::WebNode& node, 308 const WebKit::WebNode& node,
309 const WebKit::WebString& value) { 309 const WebKit::WebString& value) {
310 WebKit::WebInputElement input; 310 WebKit::WebInputElement input;
311 PasswordInfo password; 311 PasswordInfo password;
312 if (!FindLoginInfo(node, &input, &password)) 312 if (!FindLoginInfo(node, &input, &password))
313 return false; 313 return false;
314 314
315 // Set the incoming |value| in the text field and |FillUserNameAndPassword| 315 // Set the incoming |value| in the text field and |FillUserNameAndPassword|
316 // will do the rest. 316 // will do the rest.
317 input.setValue(value); 317 input.setValue(value, true);
318 return FillUserNameAndPassword(&input, &password.password_field, 318 return FillUserNameAndPassword(&input, &password.password_field,
319 password.fill_data, true, true); 319 password.fill_data, true, true);
320 } 320 }
321 321
322 bool PasswordAutofillManager::DidSelectAutofillSuggestion( 322 bool PasswordAutofillManager::DidSelectAutofillSuggestion(
323 const WebKit::WebNode& node) { 323 const WebKit::WebNode& node) {
324 WebKit::WebInputElement input; 324 WebKit::WebInputElement input;
325 PasswordInfo password; 325 PasswordInfo password;
326 return FindLoginInfo(node, &input, &password); 326 return FindLoginInfo(node, &input, &password);
327 } 327 }
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after
632 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); 632 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input);
633 if (iter == login_to_password_info_.end()) 633 if (iter == login_to_password_info_.end())
634 return false; 634 return false;
635 635
636 *found_input = input; 636 *found_input = input;
637 *found_password = iter->second; 637 *found_password = iter->second;
638 return true; 638 return true;
639 } 639 }
640 640
641 } // namespace autofill 641 } // 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