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..8ef811c3945444c0b612b2d517981e82ce1c4bf7 |
| --- /dev/null |
| +++ b/components/arc/wallpaper/arc_wallpaper_bridge.h |
| @@ -0,0 +1,48 @@ |
| +// 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 "components/arc/arc_bridge_service.h" |
|
xiyuan
2016/08/19 23:04:07
We can move this into cc file and forward declare
Muyuan
2016/08/22 22:25:00
Done.
|
| +#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" |
|
xiyuan
2016/08/19 23:04:07
Move to cc file and forward declare SetWallpaperDe
Muyuan
2016/08/22 22:25:00
Done.
|
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace arc { |
| + |
| +class ArcWallpaperBridge |
| + : public ArcService, |
| + public InstanceHolder<mojom::WallpaperInstance>::Observer, |
| + public mojom::WallpaperHost { |
| + public: |
| + explicit ArcWallpaperBridge(ArcBridgeService* bridge_service, |
|
xiyuan
2016/08/19 23:04:07
"explicit" is only needed for single arg ctor, so
Muyuan
2016/08/22 22:25:00
Done.
|
| + const std::shared_ptr<SetWallpaperDelegate>& |
| + delegate); |
| + ~ArcWallpaperBridge() override; |
| + |
| + // InstanceHolder<mojom::WallpaperInstance>::Observer overrides. |
| + void OnInstanceReady() override; |
| + |
| + // mojo::WallpaperHost overrides. |
| + void SetWallpaper(mojo::Array<uint8_t> jpeg_data) override; |
| + void GetWallpaper(const base::Callback<void(mojo::Array<uint8_t>)>& callback) |
| + override; |
| + |
| + private: |
| + std::shared_ptr<SetWallpaperDelegate> wallpaper_delegate_; |
| + mojo::Binding<mojom::WallpaperHost> binding_; |
| + base::ThreadChecker thread_checker_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(ArcWallpaperBridge); |
| +}; |
| + |
| +} // namespace arc |
| + |
| +#endif // COMPONENTS_ARC_WALLPAPER_ARC_WALLPAPER_BRIDGE_H_ |