Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / prefs / pref_service_syncable_util.h
bloba27a4ca29a1f0437af2b3af3371460125604e0a7
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_UTIL_H_
6 #define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_UTIL_H_
8 class PrefStore;
9 class Profile;
11 namespace syncable_prefs {
12 class PrefServiceSyncable;
15 // syncable_prefs::PrefServiceSyncable is a PrefService with added integration
16 // for sync, and knowledge of how to create an incognito PrefService. For code
17 // that does not need to know about the sync integration, you should use only
18 // the plain PrefService type.
20 // For this reason, Profile does not expose an accessor for the
21 // syncable_prefs::PrefServiceSyncable type. Instead, you can use the utilities
22 // below to retrieve the syncable_prefs::PrefServiceSyncable (or its incognito
23 // version) from a Profile.
24 syncable_prefs::PrefServiceSyncable* PrefServiceSyncableFromProfile(
25 Profile* profile);
26 syncable_prefs::PrefServiceSyncable* PrefServiceSyncableIncognitoFromProfile(
27 Profile* profile);
29 // Creates an incognito copy of |pref_service| that shares most prefs but uses
30 // a fresh non-persistent overlay for the user pref store and an individual
31 // extension pref store (to cache the effective extension prefs for incognito
32 // windows).
33 syncable_prefs::PrefServiceSyncable* CreateIncognitoPrefServiceSyncable(
34 syncable_prefs::PrefServiceSyncable* pref_service,
35 PrefStore* incognito_extension_pref_store);
37 #endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_UTIL_H_