summaryrefslogtreecommitdiffstats
path: root/chrome/browser/prefs/pref_service_syncable_factory.h
diff options
context:
space:
mode:
authorisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 04:22:12 +0000
committerisherman@chromium.org <isherman@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-11-19 04:22:12 +0000
commite90a01fb2a79f51878619f97e33362e24d727a9c (patch)
tree72af2c75d8b798a822169266d3610511420c50e4 /chrome/browser/prefs/pref_service_syncable_factory.h
parent86ecceb0ddcf444366d16c0dee205dedcea04f96 (diff)
downloadchromium_src-e90a01fb2a79f51878619f97e33362e24d727a9c.zip
chromium_src-e90a01fb2a79f51878619f97e33362e24d727a9c.tar.gz
chromium_src-e90a01fb2a79f51878619f97e33362e24d727a9c.tar.bz2
Clean up PrefServiceBuilder
* Use simple setters rather than With* methods. * Explicitly transfer memory ownership. * Rename "Builder" to "Factory" * Eliminate the side-effect of resetting the builder from the Create* methods. Along the way, fix a memory leak in the Android WebView. BUG=315499 TEST=none (code should continue to compile and tests should continue to pass) R=joi@chromium.org Review URL: https://codereview.chromium.org/64193003 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@235913 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/prefs/pref_service_syncable_factory.h')
-rw-r--r--chrome/browser/prefs/pref_service_syncable_factory.h45
1 files changed, 45 insertions, 0 deletions
diff --git a/chrome/browser/prefs/pref_service_syncable_factory.h b/chrome/browser/prefs/pref_service_syncable_factory.h
new file mode 100644
index 0000000..715244e
--- /dev/null
+++ b/chrome/browser/prefs/pref_service_syncable_factory.h
@@ -0,0 +1,45 @@
+// Copyright 2013 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_FACTORY_H_
+#define CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_
+
+#include "base/prefs/pref_service_factory.h"
+
+class CommandLine;
+class PrefServiceSyncable;
+
+namespace policy {
+class PolicyService;
+}
+
+namespace user_prefs {
+class PrefRegistrySyncable;
+}
+
+// A PrefServiceFactory that also knows how to build a
+// PrefServiceSyncable, and may know about Chrome concepts such as
+// PolicyService.
+class PrefServiceSyncableFactory : public base::PrefServiceFactory {
+ public:
+ PrefServiceSyncableFactory();
+ virtual ~PrefServiceSyncableFactory();
+
+#if defined(ENABLE_CONFIGURATION_POLICY)
+ // Set up policy pref stores using the given policy service.
+ void SetManagedPolicies(policy::PolicyService* service);
+ void SetRecommendedPolicies(policy::PolicyService* service);
+#endif
+
+ // Specifies to use an actual command-line backed command-line pref store.
+ void SetCommandLine(CommandLine* command_line);
+
+ scoped_ptr<PrefServiceSyncable> CreateSyncable(
+ user_prefs::PrefRegistrySyncable* registry);
+
+ private:
+ DISALLOW_COPY_AND_ASSIGN(PrefServiceSyncableFactory);
+};
+
+#endif // CHROME_BROWSER_PREFS_PREF_SERVICE_SYNCABLE_FACTORY_H_