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

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: Fix a naming issue. 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
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 // Always save generated passwords, as the user expresses explicit intent for
185 // Chrome to manage such passwords. For other passwords, respect the
186 // autocomplete attribute.
187 if (!manager->HasGeneratedPassword() && !form.password_autocomplete_set)
188 return;
189
184 PasswordForm provisionally_saved_form(form); 190 PasswordForm provisionally_saved_form(form);
185 provisionally_saved_form.ssl_valid = form.origin.SchemeIsSecure() && 191 provisionally_saved_form.ssl_valid = form.origin.SchemeIsSecure() &&
186 !delegate_->DidLastPageLoadEncounterSSLErrors(); 192 !delegate_->DidLastPageLoadEncounterSSLErrors();
187 provisionally_saved_form.preferred = true; 193 provisionally_saved_form.preferred = true;
188 manager->ProvisionallySave(provisionally_saved_form); 194 manager->ProvisionallySave(provisionally_saved_form);
189 provisional_save_manager_.swap(manager); 195 provisional_save_manager_.swap(manager);
190 } 196 }
191 197
192 void PasswordManager::SetObserver(LoginModelObserver* observer) { 198 void PasswordManager::SetObserver(LoginModelObserver* observer) {
193 observer_ = observer; 199 observer_ = observer;
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 delegate_->FillPasswordForm(fill_data); 313 delegate_->FillPasswordForm(fill_data);
308 return; 314 return;
309 } 315 }
310 default: 316 default:
311 if (observer_) { 317 if (observer_) {
312 observer_->OnAutofillDataAvailable(preferred_match.username_value, 318 observer_->OnAutofillDataAvailable(preferred_match.username_value,
313 preferred_match.password_value); 319 preferred_match.password_value);
314 } 320 }
315 } 321 }
316 } 322 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/password_manager/password_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698