Chromium Code Reviews| Index: media/mojo/clients/mojo_android_overlay.h |
| diff --git a/media/mojo/clients/mojo_android_overlay.h b/media/mojo/clients/mojo_android_overlay.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..fbb08862428d11a329dc4355eb8ca032c602bf47 |
| --- /dev/null |
| +++ b/media/mojo/clients/mojo_android_overlay.h |
| @@ -0,0 +1,65 @@ |
| +// Copyright 2017 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 MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |
| +#define MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |
| + |
| +#include "base/macros.h" |
| +#include "media/base/android/android_overlay.h" |
| +#include "media/mojo/interfaces/android_overlay.mojom.h" |
| +#include "mojo/public/cpp/bindings/binding.h" |
| + |
| +namespace service_manager { |
| +namespace mojom { |
| +class InterfaceProvider; |
| +} |
| +} |
| + |
| +namespace media { |
| + |
| +// AndroidOverlay implementation via mojo. |
| +class MojoAndroidOverlay : public AndroidOverlay, |
| + public mojom::AndroidOverlayClient { |
| + public: |
| + MojoAndroidOverlay( |
| + service_manager::mojom::InterfaceProvider* interface_provider, |
| + int render_frame_id, |
| + int renderer_pid, |
| + const AndroidOverlay::Config& config); |
| + |
| + // Testing only. |
| + MojoAndroidOverlay(mojom::AndroidOverlayProviderPtr provider_ptr, |
|
dcheng
2017/02/28 05:22:03
Since InterfaceProvider is a mojo interface, can't
liberato (no reviews please)
2017/03/06 07:51:04
good point. done.
|
| + int render_frame_id, |
| + int renderer_pid, |
| + const AndroidOverlay::Config& config); |
| + |
| + ~MojoAndroidOverlay() override; |
| + |
| + void ScheduleLayout(const gfx::Rect& rect) override; |
| + |
| + // mojom::AndroidOverlayClient |
| + void OnInitialized(mojom::AndroidOverlayPtr ptr) override; |
| + void OnSurfaceReady(uint64_t surface_key) override; |
| + void OnDestroyed() override; |
| + |
| + private: |
| + void Setup(mojom::AndroidOverlayProviderPtr provider_ptr, |
| + int render_frame_id, |
| + int renderer_pid, |
| + const AndroidOverlay::Config& config); |
| + service_manager::mojom::InterfaceProvider* interface_provider_; |
| + AndroidOverlay::Config config_; |
| + mojom::AndroidOverlayProviderPtr provider_ptr_; |
| + mojom::AndroidOverlayPtr overlay_ptr_; |
| + std::unique_ptr<mojo::Binding<mojom::AndroidOverlayClient>> binding_; |
| + |
| + // Have we received OnSurfaceReady yet? |
| + bool received_surface_ = false; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(MojoAndroidOverlay); |
| +}; |
| + |
| +} // namespace media |
| + |
| +#endif // MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |