Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(541)

Side by Side Diff: chrome/browser/autofill/autofill_manager.cc

Issue 6905044: Refactor preference syncing. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Self review Created 9 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/about_flags_unittest.cc ('k') | chrome/browser/background_contents_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
236 tab_contents->profile()->GetOriginalProfile()->GetPersonalDataManager(); 236 tab_contents->profile()->GetOriginalProfile()->GetPersonalDataManager();
237 download_manager_.SetObserver(this); 237 download_manager_.SetObserver(this);
238 } 238 }
239 239
240 AutofillManager::~AutofillManager() { 240 AutofillManager::~AutofillManager() {
241 download_manager_.SetObserver(NULL); 241 download_manager_.SetObserver(NULL);
242 } 242 }
243 243
244 // static 244 // static
245 void AutofillManager::RegisterBrowserPrefs(PrefService* prefs) { 245 void AutofillManager::RegisterBrowserPrefs(PrefService* prefs) {
246 prefs->RegisterDictionaryPref(prefs::kAutofillDialogPlacement); 246 prefs->RegisterDictionaryPref(prefs::kAutofillDialogPlacement,
247 false /* don't sync pref */);
247 } 248 }
248 249
249 // static 250 // static
250 void AutofillManager::RegisterUserPrefs(PrefService* prefs) { 251 void AutofillManager::RegisterUserPrefs(PrefService* prefs) {
251 prefs->RegisterBooleanPref(prefs::kAutofillEnabled, true); 252 prefs->RegisterBooleanPref(prefs::kAutofillEnabled,
253 true,
254 true /* sync pref */);
252 #if defined(OS_MACOSX) 255 #if defined(OS_MACOSX)
253 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, true); 256 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled,
dhollowa 2011/04/27 14:01:16 This should not be sync'd because it is not a cros
Nicolas Zea 2011/04/27 20:07:57 Thanks for catching this. The model associator act
257 true,
258 true /* sync pref */);
254 #else 259 #else
255 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled, false); 260 prefs->RegisterBooleanPref(prefs::kAutofillAuxiliaryProfilesEnabled,
261 false,
262 true /* sync pref */);
256 #endif 263 #endif
257 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate, 264 prefs->RegisterDoublePref(prefs::kAutofillPositiveUploadRate,
258 kAutofillPositiveUploadRateDefaultValue); 265 kAutofillPositiveUploadRateDefaultValue,
266 false /* don't sync pref */);
259 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate, 267 prefs->RegisterDoublePref(prefs::kAutofillNegativeUploadRate,
260 kAutofillNegativeUploadRateDefaultValue); 268 kAutofillNegativeUploadRateDefaultValue,
269 false /* don't sync pref */);
261 } 270 }
262 271
263 void AutofillManager::DidNavigateMainFramePostCommit( 272 void AutofillManager::DidNavigateMainFramePostCommit(
264 const NavigationController::LoadCommittedDetails& details, 273 const NavigationController::LoadCommittedDetails& details,
265 const ViewHostMsg_FrameNavigate_Params& params) { 274 const ViewHostMsg_FrameNavigate_Params& params) {
266 Reset(); 275 Reset();
267 } 276 }
268 277
269 bool AutofillManager::OnMessageReceived(const IPC::Message& message) { 278 bool AutofillManager::OnMessageReceived(const IPC::Message& message) {
270 bool handled = true; 279 bool handled = true;
(...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after
1030 void AutofillManager::UnpackGUIDs(int id, 1039 void AutofillManager::UnpackGUIDs(int id,
1031 GUIDPair* cc_guid, 1040 GUIDPair* cc_guid,
1032 GUIDPair* profile_guid) { 1041 GUIDPair* profile_guid) {
1033 int cc_id = id >> std::numeric_limits<unsigned short>::digits & 1042 int cc_id = id >> std::numeric_limits<unsigned short>::digits &
1034 std::numeric_limits<unsigned short>::max(); 1043 std::numeric_limits<unsigned short>::max();
1035 int profile_id = id & std::numeric_limits<unsigned short>::max(); 1044 int profile_id = id & std::numeric_limits<unsigned short>::max();
1036 1045
1037 *cc_guid = IDToGUID(cc_id); 1046 *cc_guid = IDToGUID(cc_id);
1038 *profile_guid = IDToGUID(profile_id); 1047 *profile_guid = IDToGUID(profile_id);
1039 } 1048 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags_unittest.cc ('k') | chrome/browser/background_contents_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698