| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/core/browser/autofill_experiments.h" | 5 #include "components/autofill/core/browser/autofill_experiments.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/feature_list.h" | 8 #include "base/feature_list.h" |
| 9 #include "base/metrics/field_trial.h" | 9 #include "base/metrics/field_trial.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 | 101 |
| 102 // Check Autofill sync setting. | 102 // Check Autofill sync setting. |
| 103 if (!(sync_service && sync_service->CanSyncStart() && | 103 if (!(sync_service && sync_service->CanSyncStart() && |
| 104 sync_service->GetPreferredDataTypes().Has(syncer::AUTOFILL_PROFILE))) { | 104 sync_service->GetPreferredDataTypes().Has(syncer::AUTOFILL_PROFILE))) { |
| 105 return false; | 105 return false; |
| 106 } | 106 } |
| 107 | 107 |
| 108 // Users who have enabled a passphrase have chosen to not make their sync | 108 // Users who have enabled a passphrase have chosen to not make their sync |
| 109 // information accessible to Google. Since upload makes credit card data | 109 // information accessible to Google. Since upload makes credit card data |
| 110 // available to other Google systems, disable it for passphrase users. | 110 // available to other Google systems, disable it for passphrase users. |
| 111 // We can't determine the passphrase state until the sync backend is | 111 // We can't determine the passphrase state until the sync engine is |
| 112 // initialized so disable upload if sync is not yet available. | 112 // initialized so disable upload if sync is not yet available. |
| 113 if (!sync_service->IsBackendInitialized() || | 113 if (!sync_service->IsEngineInitialized() || |
| 114 sync_service->IsUsingSecondaryPassphrase()) { | 114 sync_service->IsUsingSecondaryPassphrase()) { |
| 115 return false; | 115 return false; |
| 116 } | 116 } |
| 117 | 117 |
| 118 // Check Payments integration user setting. | 118 // Check Payments integration user setting. |
| 119 if (!pref_service->GetBoolean(prefs::kAutofillWalletImportEnabled)) | 119 if (!pref_service->GetBoolean(prefs::kAutofillWalletImportEnabled)) |
| 120 return false; | 120 return false; |
| 121 | 121 |
| 122 // Check that the user is logged into a supported domain. | 122 // Check that the user is logged into a supported domain. |
| 123 if (user_email.empty()) | 123 if (user_email.empty()) |
| (...skipping 20 matching lines...) Expand all Loading... |
| 144 | 144 |
| 145 bool IsCreditCardAutofillHttpWarningEnabled() { | 145 bool IsCreditCardAutofillHttpWarningEnabled() { |
| 146 std::string choice = | 146 std::string choice = |
| 147 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 147 base::CommandLine::ForCurrentProcess()->GetSwitchValueASCII( |
| 148 security_state::switches::kMarkHttpAs); | 148 security_state::switches::kMarkHttpAs); |
| 149 return choice == security_state::switches:: | 149 return choice == security_state::switches:: |
| 150 kMarkHttpWithPasswordsOrCcWithChipAndFormWarning; | 150 kMarkHttpWithPasswordsOrCcWithChipAndFormWarning; |
| 151 } | 151 } |
| 152 | 152 |
| 153 } // namespace autofill | 153 } // namespace autofill |
| OLD | NEW |