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

Unified Diff: chrome/browser/chromeos/arc/arc_wallpaper_handler.h

Issue 2061183002: arc: IPC method to set custom wallpaper. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Small amend. Created 4 years, 6 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: chrome/browser/chromeos/arc/arc_wallpaper_handler.h
diff --git a/chrome/browser/chromeos/arc/arc_wallpaper_handler.h b/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
new file mode 100644
index 0000000000000000000000000000000000000000..6131747724bd9a97f71a6d39844a4e27ec640fa4
--- /dev/null
+++ b/chrome/browser/chromeos/arc/arc_wallpaper_handler.h
@@ -0,0 +1,44 @@
+// 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 CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_
+#define CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_
+
+#include <stdint.h>
+
+#include <memory>
hidehiko 2016/06/16 20:31:53 Unnecessary?
Shuhei Takahashi 2016/06/17 02:12:49 Done.
+#include <set>
+
hidehiko 2016/06/16 20:31:53 #include <vector> is still needed (SetWallpaper's
Shuhei Takahashi 2016/06/17 02:12:49 Done.
+#include "base/macros.h"
+#include "chrome/browser/image_decoder.h"
+#include "components/arc/set_wallpaper_delegate.h"
+
+class SkBitmap;
+
+namespace arc {
+
+class ArcWallpaperHandler : public SetWallpaperDelegate {
+ public:
+ ArcWallpaperHandler() = default;
+ virtual ~ArcWallpaperHandler();
+
+ // SetWallpaperDelegate implementation.
+ void SetWallpaper(const std::vector<uint8_t>& jpeg_data) override;
+
+ private:
+ class ImageRequestImpl;
+
+ // Called from ImageRequestImpl on decode completion.
+ void OnImageDecoded(ImageRequestImpl* request, const SkBitmap& bitmap);
+ void OnDecodeImageFailed(ImageRequestImpl* request);
+
+ // The set of in-flight decode requests. Pointers are owned.
+ std::set<ImageRequestImpl*> inflight_requests_;
+
+ DISALLOW_COPY_AND_ASSIGN(ArcWallpaperHandler);
+};
+
+} // namespace arc
+
+#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_

Powered by Google App Engine
This is Rietveld 408576698