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

Side by Side Diff: chrome/browser/prefs/profile_pref_store_manager.cc

Issue 271793003: components: Extract pref_registry component out of user_prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: make translate_core_browser depends on pref_registry Created 6 years, 7 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/prefs/profile_pref_store_manager.h" 5 #include "chrome/browser/prefs/profile_pref_store_manager.h"
6 6
7 #include "base/file_util.h" 7 #include "base/file_util.h"
8 #include "base/json/json_file_value_serializer.h" 8 #include "base/json/json_file_value_serializer.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
11 #include "base/prefs/json_pref_store.h" 11 #include "base/prefs/json_pref_store.h"
12 #include "base/prefs/persistent_pref_store.h" 12 #include "base/prefs/persistent_pref_store.h"
13 #include "base/prefs/pref_registry_simple.h" 13 #include "base/prefs/pref_registry_simple.h"
14 #include "chrome/browser/prefs/pref_hash_store_impl.h" 14 #include "chrome/browser/prefs/pref_hash_store_impl.h"
15 #include "chrome/browser/prefs/tracked/pref_service_hash_store_contents.h" 15 #include "chrome/browser/prefs/tracked/pref_service_hash_store_contents.h"
16 #include "chrome/browser/prefs/tracked/segregated_pref_store.h" 16 #include "chrome/browser/prefs/tracked/segregated_pref_store.h"
17 #include "chrome/common/chrome_constants.h" 17 #include "chrome/common/chrome_constants.h"
18 #include "chrome/common/pref_names.h" 18 #include "chrome/common/pref_names.h"
19 #include "components/user_prefs/pref_registry_syncable.h" 19 #include "components/pref_registry/pref_registry_syncable.h"
20 20
21 namespace { 21 namespace {
22 22
23 // An adaptor that allows a PrefHashStoreImpl to access a preference store 23 // An adaptor that allows a PrefHashStoreImpl to access a preference store
24 // directly as a dictionary. Uses an equivalent layout to 24 // directly as a dictionary. Uses an equivalent layout to
25 // PrefStoreHashStoreContents. 25 // PrefStoreHashStoreContents.
26 class DictionaryHashStoreContents : public HashStoreContents { 26 class DictionaryHashStoreContents : public HashStoreContents {
27 public: 27 public:
28 // Instantiates a HashStoreContents that is a copy of |to_copy|. The copy is 28 // Instantiates a HashStoreContents that is a copy of |to_copy|. The copy is
29 // mutable but does not affect the original, nor is it persisted to disk in 29 // mutable but does not affect the original, nor is it persisted to disk in
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
415 DCHECK(kPlatformSupportsPreferenceTracking); 415 DCHECK(kPlatformSupportsPreferenceTracking);
416 416
417 PrefServiceHashStoreContents real_contents(profile_path_.AsUTF8Unsafe(), 417 PrefServiceHashStoreContents real_contents(profile_path_.AsUTF8Unsafe(),
418 local_state_); 418 local_state_);
419 return scoped_ptr<PrefHashStore>(new PrefHashStoreImpl( 419 return scoped_ptr<PrefHashStore>(new PrefHashStoreImpl(
420 seed_, 420 seed_,
421 device_id_, 421 device_id_,
422 scoped_ptr<HashStoreContents>( 422 scoped_ptr<HashStoreContents>(
423 new DictionaryHashStoreContents(real_contents)))); 423 new DictionaryHashStoreContents(real_contents))));
424 } 424 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698