| 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/autofill/browser/autofill_manager.h" | 5 #include "components/autofill/browser/autofill_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 #include <map> | 10 #include <map> |
| (...skipping 204 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 user_did_autofill_(false), | 215 user_did_autofill_(false), |
| 216 user_did_edit_autofilled_field_(false), | 216 user_did_edit_autofilled_field_(false), |
| 217 external_delegate_(NULL), | 217 external_delegate_(NULL), |
| 218 test_delegate_(NULL), | 218 test_delegate_(NULL), |
| 219 weak_ptr_factory_(this) { | 219 weak_ptr_factory_(this) { |
| 220 } | 220 } |
| 221 | 221 |
| 222 AutofillManager::~AutofillManager() {} | 222 AutofillManager::~AutofillManager() {} |
| 223 | 223 |
| 224 // static | 224 // static |
| 225 void AutofillManager::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 225 void AutofillManager::RegisterUserPrefs( |
| 226 registry->RegisterBooleanPref(prefs::kAutofillEnabled, | 226 user_prefs::PrefRegistrySyncable* registry) { |
| 227 true, | 227 registry->RegisterBooleanPref( |
| 228 PrefRegistrySyncable::SYNCABLE_PREF); | 228 prefs::kAutofillEnabled, |
| 229 true, |
| 230 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 229 #if defined(OS_MACOSX) || defined(OS_ANDROID) | 231 #if defined(OS_MACOSX) || defined(OS_ANDROID) |
| 230 registry->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, | 232 registry->RegisterBooleanPref( |
| 231 true, | 233 prefs::kAutofillAuxiliaryProfilesEnabled, |
| 232 PrefRegistrySyncable::SYNCABLE_PREF); | 234 true, |
| 235 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
| 233 #else | 236 #else |
| 234 registry->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, | 237 registry->RegisterBooleanPref( |
| 235 false, | 238 prefs::kAutofillAuxiliaryProfilesEnabled, |
| 236 PrefRegistrySyncable::UNSYNCABLE_PREF); | 239 false, |
| 240 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 237 #endif | 241 #endif |
| 238 registry->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, | 242 registry->RegisterDoublePref( |
| 239 kAutofillPositiveUploadRateDefaultValue, | 243 prefs::kAutofillPositiveUploadRate, |
| 240 PrefRegistrySyncable::UNSYNCABLE_PREF); | 244 kAutofillPositiveUploadRateDefaultValue, |
| 241 registry->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, | 245 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 242 kAutofillNegativeUploadRateDefaultValue, | 246 registry->RegisterDoublePref( |
| 243 PrefRegistrySyncable::UNSYNCABLE_PREF); | 247 prefs::kAutofillNegativeUploadRate, |
| 248 kAutofillNegativeUploadRateDefaultValue, |
| 249 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
| 244 } | 250 } |
| 245 | 251 |
| 246 void AutofillManager::DidNavigateMainFrame( | 252 void AutofillManager::DidNavigateMainFrame( |
| 247 const content::LoadCommittedDetails& details, | 253 const content::LoadCommittedDetails& details, |
| 248 const content::FrameNavigateParams& params) { | 254 const content::FrameNavigateParams& params) { |
| 249 Reset(); | 255 Reset(); |
| 250 } | 256 } |
| 251 | 257 |
| 252 void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) { | 258 void AutofillManager::SetExternalDelegate(AutofillExternalDelegate* delegate) { |
| 253 // TODO(jrg): consider passing delegate into the ctor. That won't | 259 // TODO(jrg): consider passing delegate into the ctor. That won't |
| (...skipping 1029 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1283 | 1289 |
| 1284 void AutofillManager::UpdateInitialInteractionTimestamp( | 1290 void AutofillManager::UpdateInitialInteractionTimestamp( |
| 1285 const TimeTicks& interaction_timestamp) { | 1291 const TimeTicks& interaction_timestamp) { |
| 1286 if (initial_interaction_timestamp_.is_null() || | 1292 if (initial_interaction_timestamp_.is_null() || |
| 1287 interaction_timestamp < initial_interaction_timestamp_) { | 1293 interaction_timestamp < initial_interaction_timestamp_) { |
| 1288 initial_interaction_timestamp_ = interaction_timestamp; | 1294 initial_interaction_timestamp_ = interaction_timestamp; |
| 1289 } | 1295 } |
| 1290 } | 1296 } |
| 1291 | 1297 |
| 1292 } // namespace autofill | 1298 } // namespace autofill |
| OLD | NEW |