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

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

Issue 2772673002: mash: switch to the new pref service (Closed)
Patch Set: Address review comments 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 // A |prefs::mojom::PrefStoreConnector| implementation that forwards connection
15 // calls from the root service to the active profile. Used by mash, which runs
16 // as the root user, to talk to prefs.
17 //
18 // TODO(http://crbug.com/705347): Once mash supports several profiles, remove
19 // this class and the forwarder service.
20 class ActiveProfilePrefService : public prefs::mojom::PrefStoreConnector,
21 public service_manager::InterfaceFactory<
22 prefs::mojom::PrefStoreConnector>,
23 public service_manager::Service {
24 public:
25 ActiveProfilePrefService();
26 ~ActiveProfilePrefService() override;
27
28 private:
29 // prefs::mojom::PrefStoreConnector:
30 void Connect(prefs::mojom::PrefRegistryPtr pref_registry,
31 const ConnectCallback& callback) override;
32
33 // service_manager::InterfaceFactory<PrefStoreConnector>:
34 void Create(const service_manager::Identity& remote_identity,
35 prefs::mojom::PrefStoreConnectorRequest request) override;
36
37 // service_manager::Service:
38 void OnStart() override;
39 bool OnConnect(const service_manager::ServiceInfo& remote_info,
40 service_manager::InterfaceRegistry* registry) override;
41
42 // Called if forwarding the connection request to the per-profile service
43 // instance failed.
44 void OnConnectError();
45
46 prefs::mojom::PrefStoreConnectorPtr connector_ptr_;
47 mojo::BindingSet<prefs::mojom::PrefStoreConnector> connector_bindings_;
48
49 DISALLOW_COPY_AND_ASSIGN(ActiveProfilePrefService);
50 };
51
52 #endif // CHROME_BROWSER_PREFS_ACTIVE_PROFILE_PREF_SERVICE_H_
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/preferences_chromeos_browsertest.cc ('k') | chrome/browser/prefs/active_profile_pref_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698