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

Side by Side Diff: components/filesystem/public/cpp/prefs/pref_service_factory.cc

Issue 2420253002: Rename shell namespace to service_manager (Closed)
Patch Set: . Created 4 years, 2 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "components/filesystem/public/cpp/prefs/pref_service_factory.h" 5 #include "components/filesystem/public/cpp/prefs/pref_service_factory.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h" 8 #include "components/filesystem/public/cpp/prefs/filesystem_json_pref_store.h"
9 #include "components/prefs/pref_notifier_impl.h" 9 #include "components/prefs/pref_notifier_impl.h"
10 #include "components/prefs/pref_registry.h" 10 #include "components/prefs/pref_registry.h"
11 #include "components/prefs/pref_service.h" 11 #include "components/prefs/pref_service.h"
12 #include "components/prefs/pref_value_store.h" 12 #include "components/prefs/pref_value_store.h"
13 #include "components/prefs/value_map_pref_store.h" 13 #include "components/prefs/value_map_pref_store.h"
14 #include "components/prefs/writeable_pref_store.h" 14 #include "components/prefs/writeable_pref_store.h"
15 #include "services/service_manager/public/cpp/connector.h" 15 #include "services/service_manager/public/cpp/connector.h"
16 16
17 namespace filesystem { 17 namespace filesystem {
18 18
19 namespace { 19 namespace {
20 20
21 // Do-nothing default implementation. 21 // Do-nothing default implementation.
22 void DoNothingHandleReadError(PersistentPrefStore::PrefReadError error) {} 22 void DoNothingHandleReadError(PersistentPrefStore::PrefReadError error) {}
23 23
24 } // namespace 24 } // namespace
25 25
26 std::unique_ptr<PrefService> CreatePrefService(shell::Connector* connector, 26 std::unique_ptr<PrefService> CreatePrefService(
27 PrefRegistry* pref_registry) { 27 service_manager::Connector* connector,
28 PrefRegistry* pref_registry) {
28 filesystem::mojom::FileSystemPtr filesystem; 29 filesystem::mojom::FileSystemPtr filesystem;
29 connector->ConnectToInterface("service:filesystem", &filesystem); 30 connector->ConnectToInterface("service:filesystem", &filesystem);
30 31
31 scoped_refptr<FilesystemJsonPrefStore> user_prefs = 32 scoped_refptr<FilesystemJsonPrefStore> user_prefs =
32 new FilesystemJsonPrefStore("preferences.json", std::move(filesystem), 33 new FilesystemJsonPrefStore("preferences.json", std::move(filesystem),
33 nullptr /* TODO(erg): pref filter */); 34 nullptr /* TODO(erg): pref filter */);
34 35
35 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl(); 36 PrefNotifierImpl* pref_notifier = new PrefNotifierImpl();
36 std::unique_ptr<PrefService> pref_service(new PrefService( 37 std::unique_ptr<PrefService> pref_service(new PrefService(
37 pref_notifier, 38 pref_notifier,
38 new PrefValueStore(nullptr, nullptr, nullptr, nullptr, user_prefs.get(), 39 new PrefValueStore(nullptr, nullptr, nullptr, nullptr, user_prefs.get(),
39 nullptr, pref_registry->defaults().get(), 40 nullptr, pref_registry->defaults().get(),
40 pref_notifier), 41 pref_notifier),
41 user_prefs.get(), pref_registry, base::Bind(&DoNothingHandleReadError), 42 user_prefs.get(), pref_registry, base::Bind(&DoNothingHandleReadError),
42 true /* async */)); 43 true /* async */));
43 return pref_service; 44 return pref_service;
44 } 45 }
45 46
46 } // namespace filesystem 47 } // namespace filesystem
OLDNEW
« no previous file with comments | « components/filesystem/public/cpp/prefs/pref_service_factory.h ('k') | components/font_service/font_service_app.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698