Chromium Code Reviews| Index: components/arc/wallpaper/arc_wallpaper_bridge.h |
| diff --git a/components/arc/wallpaper/arc_wallpaper_bridge.h b/components/arc/wallpaper/arc_wallpaper_bridge.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..d377daaa889eb22b2138e7a12ccb1e5b543f40c9 |
| --- /dev/null |
| +++ b/components/arc/wallpaper/arc_wallpaper_bridge.h |
| @@ -0,0 +1,49 @@ |
| +// 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 COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_ |
| +#define COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "base/macros.h" |
| +#include "base/threading/thread_checker.h" |
| +#include "components/arc/arc_service.h" |
| +#include "components/arc/common/wallpaper.mojom.h" |
| +#include "components/arc/instance_holder.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace arc { |
| + |
| +class ArcBridgeService; |
| +class SetWallpaperDelegate; |
| + |
| +class ArcWallpaperBridge |
| + : public ArcService, |
| + public InstanceHolder<mojom::WallpaperInstance>::Observer, |
| + public mojom::WallpaperHost { |
| + public: |
| + ArcWallpaperBridge(ArcBridgeService* bridge_service, |
| + SetWallpaperDelegate* delegate); |
| + ~ArcWallpaperBridge() override; |
| + |
| + // InstanceHolder<mojom::WallpaperInstance>::Observer overrides. |
| + void OnInstanceReady() override; |
| + |
| + // mojom::WallpaperHost overrides. |
| + void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; |
| + void GetWallpaper( |
| + const base::Callback<void(mojo::Array<uint8_t>)>& callback) override; |
| + |
| + private: |
| + SetWallpaperDelegate* wallpaper_delegate_; |
|
xiyuan
2016/08/23 20:43:48
nit: SetWallpaperDelegate* const
Muyuan
2016/08/23 21:20:38
Done.
|
| + mojo::Binding<mojom::WallpaperHost> binding_; |
| + base::ThreadChecker thread_checker_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcWallpaperBridge); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_ |