Chromium Code Reviews| Index: chrome/browser/chromeos/arc/arc_wallpaper_service.h |
| diff --git a/chrome/browser/chromeos/arc/arc_wallpaper_service.h b/chrome/browser/chromeos/arc/arc_wallpaper_service.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..e2d83f1d8d03f79ef0b5a220ad71a4d47a8c39be |
| --- /dev/null |
| +++ b/chrome/browser/chromeos/arc/arc_wallpaper_service.h |
| @@ -0,0 +1,60 @@ |
| +// 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_SERVICE_H_ |
| +#define CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_SERVICE_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include <memory> |
| +#include <set> |
| +#include <vector> |
| + |
| +#include "base/macros.h" |
| +#include "chrome/browser/image_decoder.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/wallpaper.mojom.h" |
| +#include "components/arc/instance_holder.h" |
| +#include "components/arc/set_wallpaper_delegate.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +class SkBitmap; |
| + |
| +namespace arc { |
| + |
| +// Lives on the UI thread. |
| +class ArcWallpaperService |
| + : public ArcService, |
| + public SetWallpaperDelegate, |
| + public ImageDecoder::ImageRequest, |
| + public InstanceHolder<mojom::WallpaperInstance>::Observer, |
| + public mojom::WallpaperHost { |
| + public: |
| + explicit ArcWallpaperService(ArcBridgeService* bridge_service); |
| + ~ArcWallpaperService() override; |
| + |
| + // InstanceHolder<mojom::WallpaperInstance>::Observer overrides. |
| + void OnInstanceReady() override; |
| + |
| + // mojom::WallpaperHost overrides. |
| + // TODO(muyuanli): change callback prototype when use_new_wrapper_types is |
| + // updated and merge them with the functions below. |
| + void SetWallpaper(mojo::Array<uint8_t> png_data) override; |
| + void GetWallpaper( |
| + const base::Callback<void(mojo::Array<uint8_t>)>& callback) override; |
|
Luis Héctor Chávez
2016/09/02 16:23:47
nit: const mojom::WallpaperHost::GetWallpaperCallb
|
| + |
| + // SetWallpaperDelegate implementation. |
| + void SetWallpaperJPEG(const std::vector<uint8_t>& jpeg_data) override; |
| + // ImageDecoder::ImageRequest implementation. |
| + void OnImageDecoded(const SkBitmap& bitmap) override; |
| + void OnDecodeImageFailed() override; |
| + |
| + private: |
| + mojo::Binding<mojom::WallpaperHost> binding_; |
| + DISALLOW_COPY_AND_ASSIGN(ArcWallpaperService); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // CHROME_BROWSER_CHROMEOS_ARC_ARC_WALLPAPER_SERVICE_H_ |