OLD | NEW |
---|---|
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "components/autofill/content/renderer/password_autofill_agent.h" | 5 #include "components/autofill/content/renderer/password_autofill_agent.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/message_loop.h" | 9 #include "base/message_loop/message_loop.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
283 return false; | 283 return false; |
284 | 284 |
285 int win_key_code = event.windowsKeyCode; | 285 int win_key_code = event.windowsKeyCode; |
286 iter->second.backspace_pressed_last = | 286 iter->second.backspace_pressed_last = |
287 (win_key_code == ui::VKEY_BACK || win_key_code == ui::VKEY_DELETE); | 287 (win_key_code == ui::VKEY_BACK || win_key_code == ui::VKEY_DELETE); |
288 return true; | 288 return true; |
289 } | 289 } |
290 | 290 |
291 bool PasswordAutofillAgent::DidAcceptAutofillSuggestion( | 291 bool PasswordAutofillAgent::DidAcceptAutofillSuggestion( |
292 const blink::WebNode& node, | 292 const blink::WebNode& node, |
293 const blink::WebString& value) { | 293 const blink::WebString& username) { |
294 blink::WebInputElement input; | 294 blink::WebInputElement input; |
295 PasswordInfo password; | 295 PasswordInfo password; |
296 if (!FindLoginInfo(node, &input, &password)) | 296 if (!FindLoginInfo(node, &input, &password)) |
297 return false; | 297 return false; |
298 | 298 |
299 // Set the incoming |value| in the text field and |FillUserNameAndPassword| | 299 // Set the incoming |value| in the text field and |FillUserNameAndPassword| |
blundell
2013/11/21 17:08:45
username
jif-google
2013/11/22 12:21:44
Done.
| |
300 // will do the rest. | 300 // will do the rest. |
301 input.setValue(value, true); | 301 input.setValue(username, true); |
302 return FillUserNameAndPassword(&input, &password.password_field, | 302 return FillUserNameAndPassword(&input, &password.password_field, |
303 password.fill_data, | 303 password.fill_data, |
304 true /* exact_username_match */, | 304 true /* exact_username_match */, |
305 true /* set_selection */); | 305 true /* set_selection */); |
306 } | 306 } |
307 | 307 |
308 bool PasswordAutofillAgent::DidClearAutofillSelection( | 308 bool PasswordAutofillAgent::DidClearAutofillSelection( |
309 const blink::WebNode& node) { | 309 const blink::WebNode& node) { |
310 blink::WebInputElement input; | 310 blink::WebInputElement input; |
311 PasswordInfo password; | 311 PasswordInfo password; |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
790 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 790 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
791 if (iter == login_to_password_info_.end()) | 791 if (iter == login_to_password_info_.end()) |
792 return false; | 792 return false; |
793 | 793 |
794 *found_input = input; | 794 *found_input = input; |
795 *found_password = iter->second; | 795 *found_password = iter->second; |
796 return true; | 796 return true; |
797 } | 797 } |
798 | 798 |
799 } // namespace autofill | 799 } // namespace autofill |
OLD | NEW |