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 586 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
597 // Don't inline autocomplete if the caret is not at the end. | 597 // Don't inline autocomplete if the caret is not at the end. |
598 // TODO(jcivelli): is there a better way to test the caret location? | 598 // TODO(jcivelli): is there a better way to test the caret location? |
599 if (username.selectionStart() != username.selectionEnd() || | 599 if (username.selectionStart() != username.selectionEnd() || |
600 username.selectionEnd() != static_cast<int>(username.value().length())) { | 600 username.selectionEnd() != static_cast<int>(username.value().length())) { |
601 return; | 601 return; |
602 } | 602 } |
603 | 603 |
604 // Show the popup with the list of available usernames. | 604 // Show the popup with the list of available usernames. |
605 ShowSuggestionPopup(fill_data, username); | 605 ShowSuggestionPopup(fill_data, username); |
606 | 606 |
607 // Fill the user and password field with the most relevant match. | 607 |
| 608 #if !defined(OS_ANDROID) |
| 609 // Fill the user and password field with the most relevant match. Android |
| 610 // only fills in the fields after the user clicks on the suggestion popup. |
608 FillUserNameAndPassword(&username, &password, fill_data, false, true); | 611 FillUserNameAndPassword(&username, &password, fill_data, false, true); |
| 612 #endif |
609 } | 613 } |
610 | 614 |
611 void PasswordAutofillManager::FrameClosing(const WebKit::WebFrame* frame) { | 615 void PasswordAutofillManager::FrameClosing(const WebKit::WebFrame* frame) { |
612 for (LoginToPasswordInfoMap::iterator iter = login_to_password_info_.begin(); | 616 for (LoginToPasswordInfoMap::iterator iter = login_to_password_info_.begin(); |
613 iter != login_to_password_info_.end();) { | 617 iter != login_to_password_info_.end();) { |
614 if (iter->first.document().frame() == frame) | 618 if (iter->first.document().frame() == frame) |
615 login_to_password_info_.erase(iter++); | 619 login_to_password_info_.erase(iter++); |
616 else | 620 else |
617 ++iter; | 621 ++iter; |
618 } | 622 } |
(...skipping 14 matching lines...) Expand all Loading... |
633 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); | 637 LoginToPasswordInfoMap::iterator iter = login_to_password_info_.find(input); |
634 if (iter == login_to_password_info_.end()) | 638 if (iter == login_to_password_info_.end()) |
635 return false; | 639 return false; |
636 | 640 |
637 *found_input = input; | 641 *found_input = input; |
638 *found_password = iter->second; | 642 *found_password = iter->second; |
639 return true; | 643 return true; |
640 } | 644 } |
641 | 645 |
642 } // namespace autofill | 646 } // namespace autofill |
OLD | NEW |