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

Side by Side Diff: components/autofill/content/renderer/password_autofill_agent.cc

Issue 1161023008: Suggest to fill password change forms (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 6 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
OLDNEW
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
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/05 21:22:30 Is this because we don't trust that |username_elem
dvadym 2015/06/09 16:40:08 Yeah, we will not trust username element and show
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
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698