| 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" |
| 11 #include "base/strings/string_util.h" | 11 #include "base/strings/string_util.h" |
| 12 #include "base/strings/utf_string_conversions.h" | 12 #include "base/strings/utf_string_conversions.h" |
| 13 #include "base/threading/platform_thread.h" | 13 #include "base/threading/platform_thread.h" |
| 14 #include "components/autofill/core/browser/autofill_field.h" | 14 #include "components/autofill/core/browser/autofill_field.h" |
| 15 #include "components/autofill/core/browser/form_structure.h" | 15 #include "components/autofill/core/browser/form_structure.h" |
| 16 #include "components/autofill/core/common/form_data_predictions.h" | 16 #include "components/autofill/core/common/form_data_predictions.h" |
| 17 #include "components/autofill/core/common/password_form_field_prediction_map.h" | 17 #include "components/autofill/core/common/password_form_field_prediction_map.h" |
| 18 #include "components/password_manager/core/browser/affiliation_utils.h" | 18 #include "components/password_manager/core/browser/affiliation_utils.h" |
| 19 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" | 19 #include "components/password_manager/core/browser/browser_save_password_progres
s_logger.h" |
| 20 #include "components/password_manager/core/browser/keychain_migration_status_mac
.h" |
| 20 #include "components/password_manager/core/browser/password_autofill_manager.h" | 21 #include "components/password_manager/core/browser/password_autofill_manager.h" |
| 21 #include "components/password_manager/core/browser/password_form_manager.h" | 22 #include "components/password_manager/core/browser/password_form_manager.h" |
| 22 #include "components/password_manager/core/browser/password_manager_client.h" | 23 #include "components/password_manager/core/browser/password_manager_client.h" |
| 23 #include "components/password_manager/core/browser/password_manager_driver.h" | 24 #include "components/password_manager/core/browser/password_manager_driver.h" |
| 24 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" | 25 #include "components/password_manager/core/browser/password_manager_metrics_util
.h" |
| 25 #include "components/password_manager/core/common/password_manager_pref_names.h" | 26 #include "components/password_manager/core/common/password_manager_pref_names.h" |
| 26 #include "components/password_manager/core/common/password_manager_switches.h" | 27 #include "components/password_manager/core/common/password_manager_switches.h" |
| 27 #include "components/pref_registry/pref_registry_syncable.h" | 28 #include "components/pref_registry/pref_registry_syncable.h" |
| 28 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" | 29 #include "net/base/registry_controlled_domains/registry_controlled_domain.h" |
| 29 | 30 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 void PasswordManager::RegisterProfilePrefs( | 136 void PasswordManager::RegisterProfilePrefs( |
| 136 user_prefs::PrefRegistrySyncable* registry) { | 137 user_prefs::PrefRegistrySyncable* registry) { |
| 137 registry->RegisterBooleanPref( | 138 registry->RegisterBooleanPref( |
| 138 prefs::kPasswordManagerSavingEnabled, | 139 prefs::kPasswordManagerSavingEnabled, |
| 139 true, | 140 true, |
| 140 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 141 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 141 registry->RegisterBooleanPref(prefs::kPasswordManagerAutoSignin, true); | 142 registry->RegisterBooleanPref(prefs::kPasswordManagerAutoSignin, true); |
| 142 registry->RegisterBooleanPref(prefs::kPasswordManagerAllowShowPasswords, | 143 registry->RegisterBooleanPref(prefs::kPasswordManagerAllowShowPasswords, |
| 143 true); | 144 true); |
| 144 registry->RegisterListPref(prefs::kPasswordManagerGroupsForDomains); | 145 registry->RegisterListPref(prefs::kPasswordManagerGroupsForDomains); |
| 146 #if defined(OS_MACOSX) |
| 147 registry->RegisterIntegerPref(prefs::kKeychainMigrationStatus, |
| 148 static_cast<int>(MigrationStatus::NOT_STARTED)); |
| 149 #endif |
| 145 } | 150 } |
| 146 | 151 |
| 147 #if defined(OS_WIN) | 152 #if defined(OS_WIN) |
| 148 // static | 153 // static |
| 149 void PasswordManager::RegisterLocalPrefs(PrefRegistrySimple* registry) { | 154 void PasswordManager::RegisterLocalPrefs(PrefRegistrySimple* registry) { |
| 150 registry->RegisterInt64Pref(prefs::kOsPasswordLastChanged, 0); | 155 registry->RegisterInt64Pref(prefs::kOsPasswordLastChanged, 0); |
| 151 registry->RegisterBooleanPref(prefs::kOsPasswordBlank, false); | 156 registry->RegisterBooleanPref(prefs::kOsPasswordBlank, false); |
| 152 } | 157 } |
| 153 #endif | 158 #endif |
| 154 | 159 |
| (...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 757 if (ServerTypeToPrediction((*field)->server_type(), &prediction_type)) | 762 if (ServerTypeToPrediction((*field)->server_type(), &prediction_type)) |
| 758 predictions[form->ToFormData()][prediction_type] = *(*field); | 763 predictions[form->ToFormData()][prediction_type] = *(*field); |
| 759 } | 764 } |
| 760 } | 765 } |
| 761 if (predictions.empty()) | 766 if (predictions.empty()) |
| 762 return; | 767 return; |
| 763 driver->AutofillDataReceived(predictions); | 768 driver->AutofillDataReceived(predictions); |
| 764 } | 769 } |
| 765 | 770 |
| 766 } // namespace password_manager | 771 } // namespace password_manager |
| OLD | NEW |