Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | |
|
hidehiko
2016/06/16 20:31:53
Unnecessary?
Shuhei Takahashi
2016/06/17 02:12:49
Done.
| |
| 11 #include <set> | |
| 12 | |
|
hidehiko
2016/06/16 20:31:53
#include <vector>
is still needed (SetWallpaper's
Shuhei Takahashi
2016/06/17 02:12:49
Done.
| |
| 13 #include "base/macros.h" | |
| 14 #include "chrome/browser/image_decoder.h" | |
| 15 #include "components/arc/set_wallpaper_delegate.h" | |
| 16 | |
| 17 class SkBitmap; | |
| 18 | |
| 19 namespace arc { | |
| 20 | |
| 21 class ArcWallpaperHandler : public SetWallpaperDelegate { | |
| 22 public: | |
| 23 ArcWallpaperHandler() = default; | |
| 24 virtual ~ArcWallpaperHandler(); | |
| 25 | |
| 26 // SetWallpaperDelegate implementation. | |
| 27 void SetWallpaper(const std::vector<uint8_t>& jpeg_data) override; | |
| 28 | |
| 29 private: | |
| 30 class ImageRequestImpl; | |
| 31 | |
| 32 // Called from ImageRequestImpl on decode completion. | |
| 33 void OnImageDecoded(ImageRequestImpl* request, const SkBitmap& bitmap); | |
| 34 void OnDecodeImageFailed(ImageRequestImpl* request); | |
| 35 | |
| 36 // The set of in-flight decode requests. Pointers are owned. | |
| 37 std::set<ImageRequestImpl*> inflight_requests_; | |
| 38 | |
| 39 DISALLOW_COPY_AND_ASSIGN(ArcWallpaperHandler); | |
| 40 }; | |
| 41 | |
| 42 } // namespace arc | |
| 43 | |
| 44 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_ | |
| OLD | NEW |