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

Side by Side Diff: services/preferences/public/cpp/pref_service_factory.h

Issue 2762333003: Pref service: add a factory to create the client lib (Closed)
Patch Set: Address more review comments from sammc@ Created 3 years, 9 months 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
OLDNEW
(Empty)
1 // Copyright 2017 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.
4
5 // This provides a way for any service to connect to the pref service to access
6 // the application's current preferences.
7
8 // Access is provided through a synchronous interface, exposed using the
9 // |PrefService| class.
10
11 #ifndef SERVICES_PREFERENCES_PUBLIC_CPP_PREF_SERVICE_FACTORY_H_
Ken Rockot(use gerrit already) 2017/03/22 06:21:01 I have to say it's kind of a bummer that the pref
tibell 2017/03/22 06:26:12 I know. I know. :) When this service has taken ove
12 #define SERVICES_PREFERENCES_PUBLIC_CPP_PREF_SERVICE_FACTORY_H_
13
14 #include <memory>
15
16 #include "base/callback.h"
17
18 class PrefRegistry;
19 class PrefService;
20
21 namespace service_manager {
22 class Connector;
23 }
24
25 namespace prefs {
26
27 // Note that |PrefService| might not be fully initialized yet and thus you need
28 // to call |AddPrefInitObserver| on it before using it. Passed |nullptr| on
29 // failure.
30 using ConnectCallback = base::Callback<void(std::unique_ptr<::PrefService>)>;
31
32 // Create a |PrefService| object acting as a client library for the pref
33 // service, by connecting to the service using |connector|. Connecting is
34 // asynchronous and |callback| will be called when it has been established. All
35 // preferences that will be accessed need to be registered in |pref_registry|
36 // first.
37 void ConnectToPrefService(service_manager::Connector* connector,
38 scoped_refptr<PrefRegistry> pref_registry,
39 const ConnectCallback& callback);
40
41 } // namespace prefs
42
43 #endif // SERVICES_PREFERENCES_PUBLIC_CPP_PREF_SERVICE_FACTORY_H_
OLDNEW
« no previous file with comments | « services/preferences/public/cpp/BUILD.gn ('k') | services/preferences/public/cpp/pref_service_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698