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

Side by Side Diff: chrome/browser/chromeos/login/signed_settings_temp_storage.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
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/chromeos/login/signed_settings_temp_storage.h" 5 #include "chrome/browser/chromeos/login/signed_settings_temp_storage.h"
6 6
7 #include "base/lazy_instance.h" 7 #include "base/lazy_instance.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/chromeos/login/ownership_service.h" 9 #include "chrome/browser/chromeos/login/ownership_service.h"
10 #include "chrome/browser/chromeos/login/signed_settings.h" 10 #include "chrome/browser/chromeos/login/signed_settings.h"
11 #include "chrome/browser/prefs/pref_service.h" 11 #include "chrome/browser/prefs/pref_service.h"
12 #include "chrome/browser/prefs/scoped_user_pref_update.h" 12 #include "chrome/browser/prefs/scoped_user_pref_update.h"
13 #include "chrome/common/pref_names.h" 13 #include "chrome/common/pref_names.h"
14 14
15 static base::LazyInstance<chromeos::SignedSettings::Delegate<bool> > 15 static base::LazyInstance<chromeos::SignedSettings::Delegate<bool> >
16 g_signed_settings_delegate(base::LINKER_INITIALIZED); 16 g_signed_settings_delegate(base::LINKER_INITIALIZED);
17 17
18 namespace chromeos { 18 namespace chromeos {
19 19
20 // static 20 // static
21 void SignedSettingsTempStorage::RegisterPrefs(PrefService* local_state) { 21 void SignedSettingsTempStorage::RegisterPrefs(PrefService* local_state) {
22 local_state->RegisterDictionaryPref(prefs::kSignedSettingsTempStorage); 22 local_state->RegisterDictionaryPref(prefs::kSignedSettingsTempStorage,
23 false /* don't sync pref */);
23 } 24 }
24 25
25 // static 26 // static
26 bool SignedSettingsTempStorage::Store(const std::string& name, 27 bool SignedSettingsTempStorage::Store(const std::string& name,
27 const std::string& value, 28 const std::string& value,
28 PrefService* local_state) { 29 PrefService* local_state) {
29 if (local_state) { 30 if (local_state) {
30 DictionaryPrefUpdate temp_storage_update( 31 DictionaryPrefUpdate temp_storage_update(
31 local_state, prefs::kSignedSettingsTempStorage); 32 local_state, prefs::kSignedSettingsTempStorage);
32 temp_storage_update->SetWithoutPathExpansion( 33 temp_storage_update->SetWithoutPathExpansion(
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after
70 SignedSettings::CreateStorePropertyOp( 71 SignedSettings::CreateStorePropertyOp(
71 *it, value, 72 *it, value,
72 g_signed_settings_delegate.Pointer())->Execute(); 73 g_signed_settings_delegate.Pointer())->Execute();
73 } 74 }
74 local_state->ClearPref(prefs::kSignedSettingsTempStorage); 75 local_state->ClearPref(prefs::kSignedSettingsTempStorage);
75 } 76 }
76 } 77 }
77 } 78 }
78 79
79 } // namespace chromeos 80 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698