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

Unified Diff: services/preferences/public/cpp/pref_store_adapter.cc

Issue 2635153002: Pref service: expose all read-only PrefStores through Mojo (Closed)
Patch Set: Address bauerb's 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 side-by-side diff with in-line comments
Download patch
Index: services/preferences/public/cpp/pref_store_adapter.cc
diff --git a/services/preferences/public/cpp/pref_store_adapter.cc b/services/preferences/public/cpp/pref_store_adapter.cc
new file mode 100644
index 0000000000000000000000000000000000000000..2cfe85a91675153b04388c2b508f927064ce8a30
--- /dev/null
+++ b/services/preferences/public/cpp/pref_store_adapter.cc
@@ -0,0 +1,40 @@
+// Copyright 2017 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.
+
+#include "services/preferences/public/cpp/pref_store_adapter.h"
+
+namespace prefs {
+
+PrefStoreAdapter::PrefStoreAdapter(scoped_refptr<PrefStore> pref_store,
+ std::unique_ptr<PrefStoreImpl> impl)
+ : pref_store_(std::move(pref_store)), impl_(std::move(impl)) {}
+
+void PrefStoreAdapter::AddObserver(PrefStore::Observer* observer) {
+ pref_store_->AddObserver(observer);
+}
+
+void PrefStoreAdapter::RemoveObserver(PrefStore::Observer* observer) {
+ pref_store_->RemoveObserver(observer);
+}
+
+bool PrefStoreAdapter::HasObservers() const {
+ return pref_store_->HasObservers();
+}
+
+bool PrefStoreAdapter::IsInitializationComplete() const {
+ return pref_store_->IsInitializationComplete();
+}
+
+bool PrefStoreAdapter::GetValue(const std::string& key,
+ const base::Value** result) const {
+ return pref_store_->GetValue(key, result);
+}
+
+std::unique_ptr<base::DictionaryValue> PrefStoreAdapter::GetValues() const {
+ return pref_store_->GetValues();
+}
+
+PrefStoreAdapter::~PrefStoreAdapter() = default;
+
+} // namespace prefs
« no previous file with comments | « services/preferences/public/cpp/pref_store_adapter.h ('k') | services/preferences/public/cpp/pref_store_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698