| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |