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

Side by Side Diff: chrome/browser/prefs/chrome_pref_service_builder.h

Issue 11570009: Split PrefService into PrefService, PrefServiceSimple and PrefServiceSyncable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: WIP, latest changes from kaiwang@ Created 8 years 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_ 5 #ifndef CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_
6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_ 6 #define CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_
7 7
8 #include "chrome/browser/prefs/pref_service_builder.h" 8 #include "chrome/browser/prefs/pref_service_builder.h"
9 9
10 namespace policy { 10 namespace policy {
11 class PolicyService; 11 class PolicyService;
12 } 12 }
13 13
14 class PrefStore; 14 class PrefStore;
15 15
16 class ChromePrefServiceBuilder : public PrefServiceBuilder { 16 class ChromePrefServiceBuilder : public PrefServiceBuilder {
Mattias Nissler (ping if slow) 2012/12/14 13:50:06 As mentioned before, I think you can just inline t
17 public: 17 public:
18 ChromePrefServiceBuilder(); 18 ChromePrefServiceBuilder();
19 virtual ~ChromePrefServiceBuilder(); 19 virtual ~ChromePrefServiceBuilder();
20 20
21 // Factory method that creates a new instance of a PrefService for 21 // Factory methods that create and initialize a new instance of a
22 // Chrome with the applicable PrefStores. The |pref_filename| points 22 // PrefService for Chrome with the applicable PrefStores. The
23 // to the user preference file. This is the usual way to create a 23 // |pref_filename| points to the user preference file. This is the
24 // new PrefService. 24 // usual way to create a new PrefService.
25 // |extension_pref_store| is used as the source for extension-controlled 25 // |extension_pref_store| is used as the source for extension-controlled
26 // preferences and may be NULL. 26 // preferences and may be NULL.
27 // |policy_service| is used as the source for mandatory or recommended 27 // |policy_service| is used as the source for mandatory or recommended
28 // policies. 28 // policies.
29 // The PrefService takes ownership of |extension_pref_store|. 29 // The PrefService takes ownership of |extension_pref_store|.
30 // If |async| is true, asynchronous version is used. 30 // If |async| is true, asynchronous version is used.
31 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to 31 // Notifies using PREF_INITIALIZATION_COMPLETED in the end. Details is set to
32 // the created PrefService or NULL if creation has failed. Note, it is 32 // the created PrefService or NULL if creation has failed. Note, it is
33 // guaranteed that in asynchronous version initialization happens after this 33 // guaranteed that in asynchronous version initialization happens after this
34 // function returned. 34 // function returned.
35 PrefService* CreateChromePrefs( 35
36 PrefServiceSimple* CreateLocalState(
36 const FilePath& pref_filename, 37 const FilePath& pref_filename,
37 base::SequencedTaskRunner* pref_io_task_runner, 38 base::SequencedTaskRunner* pref_io_task_runner,
38 policy::PolicyService* policy_service, 39 policy::PolicyService* policy_service,
40 PrefStore* extension_prefs,
41 bool async);
42
43 PrefServiceSyncable* CreateProfilePrefs(
44 const FilePath& pref_filename,
45 base::SequencedTaskRunner* pref_io_task_runner,
46 policy::PolicyService* policy_service,
39 PrefStore* extension_prefs, 47 PrefStore* extension_prefs,
40 bool async); 48 bool async);
41 49
42 private: 50 private:
51 void BuildImpl(
52 const FilePath& pref_filename,
53 base::SequencedTaskRunner* pref_io_task_runner,
54 policy::PolicyService* policy_service,
55 PrefStore* extension_prefs,
56 bool async);
57
43 void ResetDefaultState(); 58 void ResetDefaultState();
44 59
45 DISALLOW_COPY_AND_ASSIGN(ChromePrefServiceBuilder); 60 DISALLOW_COPY_AND_ASSIGN(ChromePrefServiceBuilder);
46 }; 61 };
47 62
48 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_ 63 #endif // CHROME_BROWSER_PREFS_CHROME_PREF_SERVICE_BUILDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698