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

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

Issue 2772673002: mash: switch to the new pref service (Closed)
Patch Set: Remove no longer needed tests 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 #ifndef CHROME_BROWSER_PREFS_ACTIVE_PROFILE_PREF_SERVICE_H_
6 #define CHROME_BROWSER_PREFS_ACTIVE_PROFILE_PREF_SERVICE_H_
7
8 #include "base/macros.h"
9 #include "mojo/public/cpp/bindings/binding_set.h"
10 #include "services/preferences/public/interfaces/preferences.mojom.h"
11 #include "services/service_manager/public/cpp/interface_factory.h"
12 #include "services/service_manager/public/cpp/service.h"
13
14 namespace prefs {
Sam McNally 2017/03/27 05:42:10 Remove.
tibell 2017/03/28 00:34:31 Done.
15
16 // A |mojom::PrefStoreConnector| implementation that forwards connection calls
17 // from the oot service to the active profile. Used by mash, which runs as the
sky 2017/03/27 16:00:11 If this is specific to chromeos, please move to a
sky 2017/03/27 16:00:11 oot -> root?
tibell 2017/03/28 00:34:31 Done.
tibell 2017/03/28 00:34:31 jonross@ said in his comment in chrome/app/BUILD.g
18 // root user, to talk to prefs.
Sam McNally 2017/03/27 05:42:10 Add a TODO to not do this forwarding at all.
tibell 2017/03/28 00:34:31 Done.
19 class ActiveProfilePrefService
20 : public mojom::PrefStoreConnector,
21 public service_manager::InterfaceFactory<mojom::PrefStoreConnector>,
22 public service_manager::Service {
23 public:
24 ActiveProfilePrefService();
25 ~ActiveProfilePrefService() override;
26
27 private:
28 // mojom::PrefStoreConnector:
29 void Connect(mojom::PrefRegistryPtr pref_registry,
30 const ConnectCallback& callback) override;
31
32 // service_manager::InterfaceFactory<PrefStoreConnector>:
33 void Create(const service_manager::Identity& remote_identity,
34 prefs::mojom::PrefStoreConnectorRequest request) override;
35
36 // service_manager::Service:
37 void OnStart() override;
38 bool OnConnect(const service_manager::ServiceInfo& remote_info,
39 service_manager::InterfaceRegistry* registry) override;
40
41 // Called if forwarding the connection request to the per-profile service
42 // instance failed.
43 void OnConnectError();
44
45 mojom::PrefStoreConnectorPtr connector_ptr_;
46 mojo::BindingSet<mojom::PrefStoreConnector> connector_bindings_;
47
48 DISALLOW_COPY_AND_ASSIGN(ActiveProfilePrefService);
49 };
50
51 } // namespace prefs
52
53 #endif // CHROME_BROWSER_PREFS_ACTIVE_PROFILE_PREF_SERVICE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698