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

Side by Side Diff: services/preferences/public/cpp/pref_store_adapter.cc

Issue 2635153002: Pref service: expose all read-only PrefStores through Mojo (Closed)
Patch Set: Create and register service Created 3 years, 10 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 #include "services/preferences/public/cpp/pref_store_adapter.h"
6
7 namespace prefs {
8
9 PrefStoreAdapter::PrefStoreAdapter(scoped_refptr<PrefStore> pref_store,
10 std::unique_ptr<PrefStoreImpl> impl)
11 : pref_store_(std::move(pref_store)), impl_(std::move(impl)) {}
12
13 PrefStoreAdapter::~PrefStoreAdapter() = default;
14
15 void PrefStoreAdapter::AddObserver(PrefStore::Observer* observer) {
16 pref_store_->AddObserver(observer);
17 }
18
19 void PrefStoreAdapter::RemoveObserver(PrefStore::Observer* observer) {
20 pref_store_->RemoveObserver(observer);
21 }
22
23 bool PrefStoreAdapter::HasObservers() const {
24 return pref_store_->HasObservers();
25 }
26
27 bool PrefStoreAdapter::IsInitializationComplete() const {
28 return pref_store_->IsInitializationComplete();
29 }
30
31 bool PrefStoreAdapter::GetValue(const std::string& key,
32 const base::Value** result) const {
33 return pref_store_->GetValue(key, result);
34 }
35
36 std::unique_ptr<base::DictionaryValue> PrefStoreAdapter::GetValues() const {
37 return pref_store_->GetValues();
38 }
39
40 } // namespace prefs
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698