| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 download_manager_.SetObserver(NULL); | 243 download_manager_.SetObserver(NULL); |
| 244 } | 244 } |
| 245 | 245 |
| 246 // static | 246 // static |
| 247 void AutofillManager::RegisterBrowserPrefs(PrefService* prefs) { | 247 void AutofillManager::RegisterBrowserPrefs(PrefService* prefs) { |
| 248 prefs->RegisterDictionaryPref(prefs::kAutofillDialogPlacement); | 248 prefs->RegisterDictionaryPref(prefs::kAutofillDialogPlacement); |
| 249 } | 249 } |
| 250 | 250 |
| 251 // static | 251 // static |
| 252 void AutofillManager::RegisterUserPrefs(PrefService* prefs) { | 252 void AutofillManager::RegisterUserPrefs(PrefService* prefs) { |
| 253 prefs->RegisterBooleanPref(prefs::kAutofillEnabled, true); | 253 prefs->RegisterBooleanPref(prefs::kAutofillEnabled, |
| 254 true, |
| 255 PrefService::SYNCABLE_PREF); |
| 254 #if defined(OS_MACOSX) | 256 #if defined(OS_MACOSX) |
| 255 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, true); | 257 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, |
| 258 true, |
| 259 PrefService::SYNCABLE_PREF); |
| 256 #else | 260 #else |
| 257 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, false); | 261 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, |
| 262 false, |
| 263 PrefService::UNSYNCABLE_PREF); |
| 258 #endif | 264 #endif |
| 259 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, | 265 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, |
| 260 kAutofillPositiveUploadRateDefaultValue); | 266 kAutofillPositiveUploadRateDefaultValue, |
| 267 PrefService::UNSYNCABLE_PREF); |
| 261 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, | 268 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, |
| 262 kAutofillNegativeUploadRateDefaultValue); | 269 kAutofillNegativeUploadRateDefaultValue, |
| 270 PrefService::UNSYNCABLE_PREF); |
| 263 } | 271 } |
| 264 | 272 |
| 265 void AutofillManager::DidNavigateMainFramePostCommit( | 273 void AutofillManager::DidNavigateMainFramePostCommit( |
| 266 const NavigationController::LoadCommittedDetails& details, | 274 const NavigationController::LoadCommittedDetails& details, |
| 267 const ViewHostMsg_FrameNavigate_Params& params) { | 275 const ViewHostMsg_FrameNavigate_Params& params) { |
| 268 Reset(); | 276 Reset(); |
| 269 } | 277 } |
| 270 | 278 |
| 271 bool AutofillManager::OnMessageReceived(const IPC::Message& message) { | 279 bool AutofillManager::OnMessageReceived(const IPC::Message& message) { |
| 272 bool handled = true; | 280 bool handled = true; |
| (...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1025 void AutofillManager::UnpackGUIDs(int id, | 1033 void AutofillManager::UnpackGUIDs(int id, |
| 1026 GUIDPair* cc_guid, | 1034 GUIDPair* cc_guid, |
| 1027 GUIDPair* profile_guid) { | 1035 GUIDPair* profile_guid) { |
| 1028 int cc_id = id >> std::numeric_limits<unsigned short>::digits & | 1036 int cc_id = id >> std::numeric_limits<unsigned short>::digits & |
| 1029 std::numeric_limits<unsigned short>::max(); | 1037 std::numeric_limits<unsigned short>::max(); |
| 1030 int profile_id = id & std::numeric_limits<unsigned short>::max(); | 1038 int profile_id = id & std::numeric_limits<unsigned short>::max(); |
| 1031 | 1039 |
| 1032 *cc_guid = IDToGUID(cc_id); | 1040 *cc_guid = IDToGUID(cc_id); |
| 1033 *profile_guid = IDToGUID(profile_id); | 1041 *profile_guid = IDToGUID(profile_id); |
| 1034 } | 1042 } |
| OLD | NEW |