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

Unified Diff: mash/wallpaper/wallpaper.cc

Issue 1624683002: mash: Add a simple, temporary preferences store. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: sky comments Created 4 years, 11 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
« no previous file with comments | « mash/wallpaper/DEPS ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mash/wallpaper/wallpaper.cc
diff --git a/mash/wallpaper/wallpaper.cc b/mash/wallpaper/wallpaper.cc
index fa86f6dbf7fd5038bbe863c1069f5916f4a6da35..311c4c7c731b41f3d11a2ae2ea091dbd9d6f031d 100644
--- a/mash/wallpaper/wallpaper.cc
+++ b/mash/wallpaper/wallpaper.cc
@@ -3,6 +3,8 @@
// found in the LICENSE file.
#include "base/macros.h"
+#include "base/prefs/pref_registry_simple.h"
+#include "components/filesystem/public/cpp/prefs/pref_service_factory.h"
#include "components/mus/public/cpp/property_type_converters.h"
#include "mash/wm/public/interfaces/container.mojom.h"
#include "mojo/public/c/system/main.h"
@@ -42,6 +44,10 @@ class WallpaperApplicationDelegate : public mojo::ApplicationDelegate {
WallpaperApplicationDelegate() {}
~WallpaperApplicationDelegate() override {}
+ void OnLoaded(bool whatever) {
+ // TODO(erg): Now do something with this result.
+ }
+
private:
// mojo::ApplicationDelegate:
void Initialize(mojo::ApplicationImpl* app) override {
@@ -50,6 +56,12 @@ class WallpaperApplicationDelegate : public mojo::ApplicationDelegate {
aura_init_.reset(new views::AuraInit(app, "views_mus_resources.pak"));
views::WindowManagerConnection::Create(app);
+ scoped_refptr<PrefRegistrySimple> registry = new PrefRegistrySimple;
+ registry->RegisterStringPref("filename", "", 0);
+ pref_service_ = filesystem::CreatePrefService(app, registry.get());
+ pref_service_->AddPrefInitObserver(base::Bind(
+ &WallpaperApplicationDelegate::OnLoaded, base::Unretained(this)));
+
views::Widget* widget = new views::Widget;
views::Widget::InitParams params(
views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
@@ -69,6 +81,7 @@ class WallpaperApplicationDelegate : public mojo::ApplicationDelegate {
mojo::TracingImpl tracing_;
scoped_ptr<views::AuraInit> aura_init_;
+ scoped_ptr<PrefService> pref_service_;
DISALLOW_COPY_AND_ASSIGN(WallpaperApplicationDelegate);
};
« no previous file with comments | « mash/wallpaper/DEPS ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698