OLD | NEW |
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 "components/password_manager/core/browser/password_manager.h" | 5 #include "components/password_manager/core/browser/password_manager.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/metrics/field_trial.h" | 8 #include "base/metrics/field_trial.h" |
9 #include "base/metrics/histogram_macros.h" | 9 #include "base/metrics/histogram_macros.h" |
10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 if (matched_manager_it != pending_login_managers_.end()) { | 298 if (matched_manager_it != pending_login_managers_.end()) { |
299 // Transfer ownership of the manager from |pending_login_managers_| to | 299 // Transfer ownership of the manager from |pending_login_managers_| to |
300 // |manager|. | 300 // |manager|. |
301 manager.reset(*matched_manager_it); | 301 manager.reset(*matched_manager_it); |
302 pending_login_managers_.weak_erase(matched_manager_it); | 302 pending_login_managers_.weak_erase(matched_manager_it); |
303 } else { | 303 } else { |
304 RecordFailure(NO_MATCHING_FORM, form.origin, logger.get()); | 304 RecordFailure(NO_MATCHING_FORM, form.origin, logger.get()); |
305 return; | 305 return; |
306 } | 306 } |
307 | 307 |
308 // Bail if we're missing any of the necessary form components. | |
309 if (!manager->HasValidPasswordForm()) { | |
310 RecordFailure(INVALID_FORM, form.origin, logger.get()); | |
311 return; | |
312 } | |
313 | |
314 PasswordForm provisionally_saved_form(form); | 308 PasswordForm provisionally_saved_form(form); |
315 provisionally_saved_form.ssl_valid = | 309 provisionally_saved_form.ssl_valid = |
316 form.origin.SchemeIsCryptographic() && | 310 form.origin.SchemeIsCryptographic() && |
317 !client_->DidLastPageLoadEncounterSSLErrors(); | 311 !client_->DidLastPageLoadEncounterSSLErrors(); |
318 provisionally_saved_form.preferred = true; | 312 provisionally_saved_form.preferred = true; |
319 if (logger) { | 313 if (logger) { |
320 logger->LogPasswordForm(Logger::STRING_PROVISIONALLY_SAVED_FORM, | 314 logger->LogPasswordForm(Logger::STRING_PROVISIONALLY_SAVED_FORM, |
321 provisionally_saved_form); | 315 provisionally_saved_form); |
322 } | 316 } |
323 PasswordFormManager::OtherPossibleUsernamesAction action = | 317 PasswordFormManager::OtherPossibleUsernamesAction action = |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
802 matched_manager_it = iter; | 796 matched_manager_it = iter; |
803 current_match_result = result; | 797 current_match_result = result; |
804 } | 798 } |
805 } | 799 } |
806 if (matched_manager_it != pending_login_managers_.end()) | 800 if (matched_manager_it != pending_login_managers_.end()) |
807 return *matched_manager_it; | 801 return *matched_manager_it; |
808 return nullptr; | 802 return nullptr; |
809 } | 803 } |
810 | 804 |
811 } // namespace password_manager | 805 } // namespace password_manager |
OLD | NEW |