| 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_SERVICE_H_ | |
| 6 #define CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_SERVICE_H_ | |
| 7 | |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include "ash/common/wallpaper/wallpaper_controller_observer.h" | |
| 11 #include "base/macros.h" | |
| 12 #include "chrome/browser/image_decoder.h" | |
| 13 #include "components/arc/arc_service.h" | |
| 14 #include "components/arc/common/wallpaper.mojom.h" | |
| 15 #include "components/arc/instance_holder.h" | |
| 16 #include "mojo/public/cpp/bindings/binding.h" | |
| 17 | |
| 18 class SkBitmap; | |
| 19 | |
| 20 namespace arc { | |
| 21 | |
| 22 // Lives on the UI thread. | |
| 23 class ArcWallpaperService | |
| 24 : public ArcService, | |
| 25 public ash::WallpaperControllerObserver, | |
| 26 public ImageDecoder::ImageRequest, | |
| 27 public InstanceHolder<mojom::WallpaperInstance>::Observer, | |
| 28 public mojom::WallpaperHost { | |
| 29 public: | |
| 30 explicit ArcWallpaperService(ArcBridgeService* bridge_service); | |
| 31 ~ArcWallpaperService() override; | |
| 32 | |
| 33 // InstanceHolder<mojom::WallpaperInstance>::Observer overrides. | |
| 34 void OnInstanceReady() override; | |
| 35 void OnInstanceClosed() override; | |
| 36 | |
| 37 // mojom::WallpaperHost overrides. | |
| 38 // TODO(muyuanli): change callback prototype when use_new_wrapper_types is | |
| 39 // updated and merge them with the functions below. | |
| 40 void SetWallpaper(mojo::Array<uint8_t> png_data) override; | |
| 41 void GetWallpaper(const GetWallpaperCallback& callback) override; | |
| 42 | |
| 43 // ImageDecoder::ImageRequest implementation. | |
| 44 void OnImageDecoded(const SkBitmap& bitmap) override; | |
| 45 void OnDecodeImageFailed() override; | |
| 46 | |
| 47 // WallpaperControllerObserver implementation. | |
| 48 void OnWallpaperDataChanged() override; | |
| 49 | |
| 50 private: | |
| 51 mojo::Binding<mojom::WallpaperHost> binding_; | |
| 52 DISALLOW_COPY_AND_ASSIGN(ArcWallpaperService); | |
| 53 }; | |
| 54 | |
| 55 } // namespace arc | |
| 56 | |
| 57 #endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_SERVICE_H_ | |
| OLD | NEW |