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

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: Address gcasto's comments 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 1087 matching lines...) Expand 10 before | Expand all | Expand 10 after
1098 1098
1099 LoginToPasswordInfoKeyMap::const_iterator key_it = 1099 LoginToPasswordInfoKeyMap::const_iterator key_it =
1100 login_to_password_info_key_.find(user_input); 1100 login_to_password_info_key_.find(user_input);
1101 DCHECK(key_it != login_to_password_info_key_.end()); 1101 DCHECK(key_it != login_to_password_info_key_.end());
1102 1102
1103 float scale = web_view_->pageScaleFactor(); 1103 float scale = web_view_->pageScaleFactor();
1104 gfx::RectF bounding_box_scaled(bounding_box.x() * scale, 1104 gfx::RectF bounding_box_scaled(bounding_box.x() * scale,
1105 bounding_box.y() * scale, 1105 bounding_box.y() * scale,
1106 bounding_box.width() * scale, 1106 bounding_box.width() * scale,
1107 bounding_box.height() * scale); 1107 bounding_box.height() * scale);
1108 int options = 0;
1109 if (show_all)
1110 options |= ShowPasswordSuggestionsOptions::SHOW_ALL;
1108 Send(new AutofillHostMsg_ShowPasswordSuggestions( 1111 Send(new AutofillHostMsg_ShowPasswordSuggestions(
1109 routing_id(), key_it->second, field.text_direction, user_input.value(), 1112 routing_id(), key_it->second, field.text_direction, user_input.value(),
1110 show_all, bounding_box_scaled)); 1113 options, bounding_box_scaled));
1111 1114
1112 bool suggestions_present = false; 1115 bool suggestions_present = false;
1113 if (GetSuggestionsStats(fill_data, user_input.value(), show_all, 1116 if (GetSuggestionsStats(fill_data, user_input.value(), show_all,
1114 &suggestions_present)) { 1117 &suggestions_present)) {
1115 usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN; 1118 usernames_usage_ = OTHER_POSSIBLE_USERNAME_SHOWN;
1116 } 1119 }
1117 return suggestions_present; 1120 return suggestions_present;
1118 } 1121 }
1119 1122
1120 void PasswordAutofillAgent::PerformInlineAutocomplete( 1123 void PasswordAutofillAgent::PerformInlineAutocomplete(
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
1226 scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form)); 1229 scoped_ptr<PasswordForm> password_form(CreatePasswordForm(form));
1227 if (!password_form || (restriction == RESTRICTION_NON_EMPTY_PASSWORD && 1230 if (!password_form || (restriction == RESTRICTION_NON_EMPTY_PASSWORD &&
1228 password_form->password_value.empty() && 1231 password_form->password_value.empty() &&
1229 password_form->new_password_value.empty())) { 1232 password_form->new_password_value.empty())) {
1230 return; 1233 return;
1231 } 1234 }
1232 provisionally_saved_forms_[frame].reset(password_form.release()); 1235 provisionally_saved_forms_[frame].reset(password_form.release());
1233 } 1236 }
1234 1237
1235 } // namespace autofill 1238 } // namespace autofill
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698