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

Side by Side Diff: chrome/browser/password_manager/password_manager.cc

Issue 11446028: Ignore autocomplete=off when password manager is saving the generated passwords during account crea… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address gcasto's comment Created 8 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 | Annotate | Revision Log
OLDNEW
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/browser/password_manager/password_manager.h" 5 #include "chrome/browser/password_manager/password_manager.h"
6 6
7 #include "base/metrics/histogram.h" 7 #include "base/metrics/histogram.h"
8 #include "base/threading/platform_thread.h" 8 #include "base/threading/platform_thread.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
174 174
175 // Also get out of here if the user told us to 'never remember' passwords for 175 // Also get out of here if the user told us to 'never remember' passwords for
176 // this form. 176 // this form.
177 if (manager->IsBlacklisted()) 177 if (manager->IsBlacklisted())
178 return; 178 return;
179 179
180 // Bail if we're missing any of the necessary form components. 180 // Bail if we're missing any of the necessary form components.
181 if (!manager->HasValidPasswordForm()) 181 if (!manager->HasValidPasswordForm())
182 return; 182 return;
183 183
184 // Don't save the password if it is not a generated password and autocomplete
185 // is turned off.
Ilya Sherman 2012/12/06 22:55:59 Optional nit: I would suggest phrasing this as fol
zysxqn 2012/12/06 23:54:49 Done.
186 if (!manager->HasGeneratedPassword() && !form.password_should_autocomplete)
187 return;
188
184 PasswordForm provisionally_saved_form(form); 189 PasswordForm provisionally_saved_form(form);
185 provisionally_saved_form.ssl_valid = form.origin.SchemeIsSecure() && 190 provisionally_saved_form.ssl_valid = form.origin.SchemeIsSecure() &&
186 !delegate_->DidLastPageLoadEncounterSSLErrors(); 191 !delegate_->DidLastPageLoadEncounterSSLErrors();
187 provisionally_saved_form.preferred = true; 192 provisionally_saved_form.preferred = true;
188 manager->ProvisionallySave(provisionally_saved_form); 193 manager->ProvisionallySave(provisionally_saved_form);
189 provisional_save_manager_.swap(manager); 194 provisional_save_manager_.swap(manager);
190 } 195 }
191 196
192 void PasswordManager::SetObserver(LoginModelObserver* observer) { 197 void PasswordManager::SetObserver(LoginModelObserver* observer) {
193 observer_ = observer; 198 observer_ = observer;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 delegate_->FillPasswordForm(fill_data); 312 delegate_->FillPasswordForm(fill_data);
308 return; 313 return;
309 } 314 }
310 default: 315 default:
311 if (observer_) { 316 if (observer_) {
312 observer_->OnAutofillDataAvailable(preferred_match.username_value, 317 observer_->OnAutofillDataAvailable(preferred_match.username_value,
313 preferred_match.password_value); 318 preferred_match.password_value);
314 } 319 }
315 } 320 }
316 } 321 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698