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

Unified Diff: base/prefs/pref_service_builder.h

Issue 64193003: Clean up PrefServiceBuilder (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix memory ownership bug in ProxyPolicyTest Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/prefs/pref_service.h ('k') | base/prefs/pref_service_builder.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/prefs/pref_service_builder.h
diff --git a/base/prefs/pref_service_builder.h b/base/prefs/pref_service_builder.h
deleted file mode 100644
index 7af43926233464654bdf2920d548ff624f8b0d7d..0000000000000000000000000000000000000000
--- a/base/prefs/pref_service_builder.h
+++ /dev/null
@@ -1,74 +0,0 @@
-// 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 BASE_PREFS_PREF_SERVICE_BUILDER_H_
-#define BASE_PREFS_PREF_SERVICE_BUILDER_H_
-
-#include "base/basictypes.h"
-#include "base/callback.h"
-#include "base/memory/ref_counted.h"
-#include "base/prefs/base_prefs_export.h"
-#include "base/prefs/persistent_pref_store.h"
-#include "base/prefs/pref_registry.h"
-#include "base/prefs/pref_store.h"
-
-class PrefService;
-
-namespace base {
-class FilePath;
-class SequencedTaskRunner;
-}
-
-// A class that allows convenient building of PrefService.
-class BASE_PREFS_EXPORT PrefServiceBuilder {
- public:
- PrefServiceBuilder();
- virtual ~PrefServiceBuilder();
-
- // Functions for setting the various parameters of the PrefService to build.
- // These take ownership of the |store| parameter.
- PrefServiceBuilder& WithManagedPrefs(PrefStore* store);
- PrefServiceBuilder& WithSupervisedUserPrefs(PrefStore* store);
- PrefServiceBuilder& WithExtensionPrefs(PrefStore* store);
- PrefServiceBuilder& WithCommandLinePrefs(PrefStore* store);
- PrefServiceBuilder& WithUserPrefs(PersistentPrefStore* store);
- PrefServiceBuilder& WithRecommendedPrefs(PrefStore* store);
-
- // Sets up error callback for the PrefService. A do-nothing default
- // is provided if this is not called.
- PrefServiceBuilder& WithReadErrorCallback(
- const base::Callback<void(PersistentPrefStore::PrefReadError)>&
- read_error_callback);
-
- // Specifies to use an actual file-backed user pref store.
- PrefServiceBuilder& WithUserFilePrefs(
- const base::FilePath& prefs_file,
- base::SequencedTaskRunner* task_runner);
-
- PrefServiceBuilder& WithAsync(bool async);
-
- // Creates a PrefService object initialized with the parameters from
- // this builder.
- virtual PrefService* Create(PrefRegistry* registry);
-
- protected:
- virtual void ResetDefaultState();
-
- scoped_refptr<PrefStore> managed_prefs_;
- scoped_refptr<PrefStore> supervised_user_prefs_;
- scoped_refptr<PrefStore> extension_prefs_;
- scoped_refptr<PrefStore> command_line_prefs_;
- scoped_refptr<PersistentPrefStore> user_prefs_;
- scoped_refptr<PrefStore> recommended_prefs_;
-
- base::Callback<void(PersistentPrefStore::PrefReadError)> read_error_callback_;
-
- // Defaults to false.
- bool async_;
-
- private:
- DISALLOW_COPY_AND_ASSIGN(PrefServiceBuilder);
-};
-
-#endif // BASE_PREFS_PREF_SERVICE_BUILDER_H_
« no previous file with comments | « base/prefs/pref_service.h ('k') | base/prefs/pref_service_builder.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698