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

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

Issue 767353002: Support for password manager suggestions on password fields. (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Rebase on ToT Created 6 years 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/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 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 LoginToPasswordInfoKeyMap::const_iterator key_it = 1060 LoginToPasswordInfoKeyMap::const_iterator key_it =
1061 login_to_password_info_key_.find(user_input); 1061 login_to_password_info_key_.find(user_input);
1062 DCHECK(key_it != login_to_password_info_key_.end()); 1062 DCHECK(key_it != login_to_password_info_key_.end());
1063 1063
1064 float scale = 1064 float scale =
1065 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor(); 1065 render_frame()->GetRenderView()->GetWebView()->pageScaleFactor();
1066 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, 1066 gfx::RectF bounding_box_scaled(bounding_box.x() * scale,
1067 bounding_box.y() * scale, 1067 bounding_box.y() * scale,
1068 bounding_box.width() * scale, 1068 bounding_box.width() * scale,
1069 bounding_box.height() * scale); 1069 bounding_box.height() * scale);
1070 int options = 0;
1071 if (show_all)
1072 options |= ShowPasswordSuggestionsOptions::SHOW_ALL;
1070 Send(new AutofillHostMsg_ShowPasswordSuggestions( 1073 Send(new AutofillHostMsg_ShowPasswordSuggestions(
1071 routing_id(), key_it->second, field.text_direction, user_input.value(), 1074 routing_id(), key_it->second, field.text_direction, user_input.value(),
1072 show_all, bounding_box_scaled)); 1075 options, bounding_box_scaled));
1073 1076
1074 bool suggestions_present = false; 1077 bool suggestions_present = false;
1075 if (GetSuggestionsStats(fill_data, user_input.value(), show_all, 1078 if (GetSuggestionsStats(fill_data, user_input.value(), show_all,
1076 &suggestions_present)) { 1079 &suggestions_present)) {
1077 usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN; 1080 usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN;
1078 } 1081 }
1079 return suggestions_present; 1082 return suggestions_present;
1080 } 1083 }
1081 1084
1082 void PasswordAutofillAgent::PerformInlineAutocomplete( 1085 void PasswordAutofillAgent::PerformInlineAutocomplete(
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
1211 agent_->WillSendSubmitEvent(frame, form); 1214 agent_->WillSendSubmitEvent(frame, form);
1212 } 1215 }
1213 1216
1214 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::WillSubmitForm( 1217 void PasswordAutofillAgent::LegacyPasswordAutofillAgent::WillSubmitForm(
1215 blink::WebLocalFrame* frame, 1218 blink::WebLocalFrame* frame,
1216 const blink::WebFormElement& form) { 1219 const blink::WebFormElement& form) {
1217 agent_->WillSubmitForm(frame, form); 1220 agent_->WillSubmitForm(frame, form);
1218 } 1221 }
1219 1222
1220 } // namespace autofill 1223 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698