| 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 <set> |
| 11 #include <vector> |
| 12 |
| 13 #include "base/macros.h" |
| 14 #include "base/threading/thread_checker.h" |
| 15 #include "chrome/browser/image_decoder.h" |
| 16 #include "components/arc/set_wallpaper_delegate.h" |
| 17 |
| 18 class SkBitmap; |
| 19 |
| 20 namespace arc { |
| 21 |
| 22 class ArcWallpaperHandler : public SetWallpaperDelegate { |
| 23 public: |
| 24 ArcWallpaperHandler(); |
| 25 ~ArcWallpaperHandler() override; |
| 26 |
| 27 // SetWallpaperDelegate implementation. |
| 28 void SetWallpaper(const std::vector<uint8_t>& jpeg_data) override; |
| 29 |
| 30 private: |
| 31 class ImageRequestImpl; |
| 32 |
| 33 // Called from ImageRequestImpl on decode completion. |
| 34 void OnImageDecoded(ImageRequestImpl* request, const SkBitmap& bitmap); |
| 35 void OnDecodeImageFailed(ImageRequestImpl* request); |
| 36 |
| 37 base::ThreadChecker thread_checker_; |
| 38 |
| 39 // The set of in-flight decode requests. Pointers are owned. |
| 40 std::set<ImageRequestImpl*> inflight_requests_; |
| 41 |
| 42 DISALLOW_COPY_AND_ASSIGN(ArcWallpaperHandler); |
| 43 }; |
| 44 |
| 45 } // namespace arc |
| 46 |
| 47 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_HANDLER_H_ |
| OLD | NEW |