summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/pref_service_syncable_builder.h
blob: df0e53d0a7bf289c042ee37894b4f4f7279966b6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_BUILDER_H_
#define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_BUILDER_H_

#include "base/prefs/pref_service_builder.h"

class CommandLine;
class PrefServiceSyncable;

namespace policy {
class PolicyService;
}

namespace user_prefs {
class PrefRegistrySyncable;
}

// A PrefServiceBuilder that also knows how to build a
// PrefServiceSyncable, and may know about Chrome concepts such as
// PolicyService.
class PrefServiceSyncableBuilder : public PrefServiceBuilder {
 public:
  PrefServiceSyncableBuilder();
  virtual ~PrefServiceSyncableBuilder();

#if defined(ENABLE_CONFIGURATION_POLICY)
  // Set up policy pref stores using the given policy service.
  PrefServiceSyncableBuilder& WithManagedPolicies(
      policy::PolicyService* service);
  PrefServiceSyncableBuilder& WithRecommendedPolicies(
      policy::PolicyService* service);
#endif

  // Specifies to use an actual command-line backed command-line pref store.
  PrefServiceSyncableBuilder& WithCommandLine(CommandLine* command_line);

  virtual PrefServiceSyncable* CreateSyncable(
      user_prefs::PrefRegistrySyncable* registry);

 private:
  DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableBuilder);
};

#endif  // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_BUILDER_H_