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

Unified Diff: components/arc/wallpaper/arc_wallpaper_bridge.h

Issue 2264743002: cheets: implement cros side of WallpaperManagerService. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cheets: implement cros side of WallpaperManagerService. Created 4 years, 4 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: components/arc/wallpaper/arc_wallpaper_bridge.h
diff --git a/components/arc/wallpaper/arc_wallpaper_bridge.h b/components/arc/wallpaper/arc_wallpaper_bridge.h
new file mode 100644
index 0000000000000000000000000000000000000000..abb881927c8fe12bff4ea20a0945d446c006d77d
--- /dev/null
+++ b/components/arc/wallpaper/arc_wallpaper_bridge.h
@@ -0,0 +1,51 @@
+// Copyright 2016 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.
+
+#ifndef COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_
+#define COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_
+
+#include <stdint.h>
+
+#include "base/macros.h"
+#include "base/threading/thread_checker.h"
+#include "components/arc/arc_service.h"
+#include "components/arc/common/wallpaper.mojom.h"
+#include "components/arc/instance_holder.h"
+#include "mojo/public/cpp/bindings/binding.h"
+
+namespace arc {
+
+class ArcBridgeService;
+class SetWallpaperDelegate;
+
+class ArcWallpaperBridge
+ : public ArcService,
+ public InstanceHolder<mojom::WallpaperInstance>::Observer,
+ public mojom::WallpaperHost {
+ public:
+ ArcWallpaperBridge(ArcBridgeService* bridge_service,
+ SetWallpaperDelegate* delegate);
+ ~ArcWallpaperBridge() override;
+
+ // InstanceHolder<mojom::WallpaperInstance>::Observer overrides.
+ void OnInstanceReady() override;
+
+ // mojom::WallpaperHost overrides.
+ // TODO(muyuanli): change callback prototype when use_new_wrapper_types is
+ // updated.
+ void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override;
+ void GetWallpaper(
+ const base::Callback<void(mojo::Array<uint8_t>)>& callback) override;
+
+ private:
+ SetWallpaperDelegate* const wallpaper_delegate_;
+ mojo::Binding<mojom::WallpaperHost> binding_;
+ base::ThreadChecker thread_checker_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcWallpaperBridge);
+};
+
+} // namespace arc
+
+#endif // COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_

Powered by Google App Engine
This is Rietveld 408576698