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 "chrome/browser/autofill/autofill_manager.h" | 5 #include "chrome/browser/autofill/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 21 matching lines...) Expand all Loading... |
32 #include "chrome/browser/autofill/autofill_metrics.h" | 32 #include "chrome/browser/autofill/autofill_metrics.h" |
33 #include "chrome/browser/autofill/autofill_profile.h" | 33 #include "chrome/browser/autofill/autofill_profile.h" |
34 #include "chrome/browser/autofill/autofill_type.h" | 34 #include "chrome/browser/autofill/autofill_type.h" |
35 #include "chrome/browser/autofill/credit_card.h" | 35 #include "chrome/browser/autofill/credit_card.h" |
36 #include "chrome/browser/autofill/form_structure.h" | 36 #include "chrome/browser/autofill/form_structure.h" |
37 #include "chrome/browser/autofill/password_generator.h" | 37 #include "chrome/browser/autofill/password_generator.h" |
38 #include "chrome/browser/autofill/personal_data_manager.h" | 38 #include "chrome/browser/autofill/personal_data_manager.h" |
39 #include "chrome/browser/autofill/personal_data_manager_factory.h" | 39 #include "chrome/browser/autofill/personal_data_manager_factory.h" |
40 #include "chrome/browser/autofill/phone_number.h" | 40 #include "chrome/browser/autofill/phone_number.h" |
41 #include "chrome/browser/autofill/phone_number_i18n.h" | 41 #include "chrome/browser/autofill/phone_number_i18n.h" |
| 42 #include "chrome/browser/prefs/pref_service.h" |
42 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" | 43 #include "chrome/browser/ui/autofill/autofill_dialog_controller.h" |
43 #include "chrome/common/autofill_messages.h" | 44 #include "chrome/common/autofill_messages.h" |
44 #include "chrome/common/chrome_notification_types.h" | 45 #include "chrome/common/chrome_notification_types.h" |
45 #include "chrome/common/chrome_switches.h" | 46 #include "chrome/common/chrome_switches.h" |
46 #include "chrome/common/form_data.h" | 47 #include "chrome/common/form_data.h" |
47 #include "chrome/common/form_data_predictions.h" | 48 #include "chrome/common/form_data_predictions.h" |
48 #include "chrome/common/form_field_data.h" | 49 #include "chrome/common/form_field_data.h" |
49 #include "chrome/common/password_form_fill_data.h" | 50 #include "chrome/common/password_form_fill_data.h" |
50 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
51 #include "chrome/common/url_constants.h" | 52 #include "chrome/common/url_constants.h" |
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
217 registrar_.Add( | 218 registrar_.Add( |
218 prefs::kPasswordGenerationEnabled, | 219 prefs::kPasswordGenerationEnabled, |
219 base::Bind(&AutofillManager::OnPasswordGenerationEnabledChanged, | 220 base::Bind(&AutofillManager::OnPasswordGenerationEnabledChanged, |
220 base::Unretained(this))); | 221 base::Unretained(this))); |
221 } | 222 } |
222 | 223 |
223 AutofillManager::~AutofillManager() { | 224 AutofillManager::~AutofillManager() { |
224 } | 225 } |
225 | 226 |
226 // static | 227 // static |
227 void AutofillManager::RegisterUserPrefs(PrefServiceBase* prefs) { | 228 void AutofillManager::RegisterUserPrefs(PrefServiceSyncable* prefs) { |
228 prefs->RegisterBooleanPref(prefs::kAutofillEnabled, | 229 prefs->RegisterBooleanPref(prefs::kAutofillEnabled, |
229 true, | 230 true, |
230 PrefServiceBase::SYNCABLE_PREF); | 231 PrefServiceSyncable::SYNCABLE_PREF); |
231 prefs->RegisterBooleanPref(prefs::kPasswordGenerationEnabled, | 232 prefs->RegisterBooleanPref(prefs::kPasswordGenerationEnabled, |
232 true, | 233 true, |
233 PrefServiceBase::SYNCABLE_PREF); | 234 PrefServiceSyncable::SYNCABLE_PREF); |
234 #if defined(OS_MACOSX) | 235 #if defined(OS_MACOSX) |
235 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, | 236 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, |
236 true, | 237 true, |
237 PrefServiceBase::SYNCABLE_PREF); | 238 PrefServiceSyncable::SYNCABLE_PREF); |
238 #else | 239 #else |
239 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, | 240 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, |
240 false, | 241 false, |
241 PrefServiceBase::UNSYNCABLE_PREF); | 242 PrefServiceSyncable::UNSYNCABLE_PREF); |
242 #endif | 243 #endif |
243 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, | 244 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, |
244 kAutofillPositiveUploadRateDefaultValue, | 245 kAutofillPositiveUploadRateDefaultValue, |
245 PrefServiceBase::UNSYNCABLE_PREF); | 246 PrefServiceSyncable::UNSYNCABLE_PREF); |
246 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, | 247 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, |
247 kAutofillNegativeUploadRateDefaultValue, | 248 kAutofillNegativeUploadRateDefaultValue, |
248 PrefServiceBase::UNSYNCABLE_PREF); | 249 PrefServiceSyncable::UNSYNCABLE_PREF); |
249 } | 250 } |
250 | 251 |
251 void AutofillManager::RegisterWithSyncService() { | 252 void AutofillManager::RegisterWithSyncService() { |
252 ProfileSyncServiceBase* service = manager_delegate_->GetProfileSyncService(); | 253 ProfileSyncServiceBase* service = manager_delegate_->GetProfileSyncService(); |
253 if (service) | 254 if (service) |
254 service->AddObserver(this); | 255 service->AddObserver(this); |
255 } | 256 } |
256 | 257 |
257 void AutofillManager::SendPasswordGenerationStateToRenderer( | 258 void AutofillManager::SendPasswordGenerationStateToRenderer( |
258 content::RenderViewHost* host, bool enabled) { | 259 content::RenderViewHost* host, bool enabled) { |
(...skipping 1084 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1343 *profile_guid = IDToGUID(profile_id); | 1344 *profile_guid = IDToGUID(profile_id); |
1344 } | 1345 } |
1345 | 1346 |
1346 void AutofillManager::UpdateInitialInteractionTimestamp( | 1347 void AutofillManager::UpdateInitialInteractionTimestamp( |
1347 const TimeTicks& interaction_timestamp) { | 1348 const TimeTicks& interaction_timestamp) { |
1348 if (initial_interaction_timestamp_.is_null() || | 1349 if (initial_interaction_timestamp_.is_null() || |
1349 interaction_timestamp < initial_interaction_timestamp_) { | 1350 interaction_timestamp < initial_interaction_timestamp_) { |
1350 initial_interaction_timestamp_ = interaction_timestamp; | 1351 initial_interaction_timestamp_ = interaction_timestamp; |
1351 } | 1352 } |
1352 } | 1353 } |
OLD | NEW |