Chromium Code Reviews| 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/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 if (!IsElementAutocompletable(element) || | 851 if (!IsElementAutocompletable(element) || |
| 852 !IsElementAutocompletable(password_info->password_field)) | 852 !IsElementAutocompletable(password_info->password_field)) |
| 853 return true; | 853 return true; |
| 854 | 854 |
| 855 bool username_is_available = | 855 bool username_is_available = |
| 856 !username_element->isNull() && IsElementEditable(*username_element); | 856 !username_element->isNull() && IsElementEditable(*username_element); |
| 857 // If the element is a password field, a popup should only be shown if there | 857 // If the element is a password field, a popup should only be shown if there |
| 858 // is no username or the corresponding username element is not editable since | 858 // is no username or the corresponding username element is not editable since |
| 859 // it is only in that case that the username element does not have a | 859 // it is only in that case that the username element does not have a |
| 860 // suggestions popup. | 860 // suggestions popup. |
| 861 if (element.isPasswordField() && username_is_available) | 861 if (element.isPasswordField() && |
| 862 !password_info->fill_data.is_password_change_form && | |
|
Garrett Casto
2015/06/09 23:56:22
The more that I think about this, the more that I'
dvadym
2015/06/10 14:22:03
Yeah, I'm also not sure that this is the best appr
Garrett Casto
2015/06/11 00:07:36
That is true. It is already a problem we could hav
dvadym
2015/06/11 12:00:53
No, I didn't notice any sites where it can be a pr
| |
| 863 username_is_available) | |
| 862 return true; | 864 return true; |
| 863 | 865 |
| 864 // Chrome should never show more than one account for a password element since | 866 // Chrome should never show more than one account for a password element since |
| 865 // this implies that the username element cannot be modified. Thus even if | 867 // this implies that the username element cannot be modified. Thus even if |
| 866 // |show_all| is true, check if the element in question is a password element | 868 // |show_all| is true, check if the element in question is a password element |
| 867 // for the call to ShowSuggestionPopup. | 869 // for the call to ShowSuggestionPopup. |
| 868 return ShowSuggestionPopup( | 870 return ShowSuggestionPopup( |
| 869 password_info->fill_data, | 871 password_info->fill_data, |
| 870 username_element->isNull() ? element : *username_element, | 872 username_element->isNull() ? element : *username_element, |
| 871 show_all && !element.isPasswordField(), element.isPasswordField()); | 873 show_all && !element.isPasswordField(), element.isPasswordField()); |
| (...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1472 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { | 1474 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::DidStopLoading() { |
| 1473 agent_->DidStopLoading(); | 1475 agent_->DidStopLoading(); |
| 1474 } | 1476 } |
| 1475 | 1477 |
| 1476 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: | 1478 void PasswordAutofillAgent::LegacyPasswordAutofillAgent:: |
| 1477 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { | 1479 DidStartProvisionalLoad(blink::WebLocalFrame* navigated_frame) { |
| 1478 agent_->LegacyDidStartProvisionalLoad(navigated_frame); | 1480 agent_->LegacyDidStartProvisionalLoad(navigated_frame); |
| 1479 } | 1481 } |
| 1480 | 1482 |
| 1481 } // namespace autofill | 1483 } // namespace autofill |
| OLD | NEW |