OLD | NEW |
(Empty) | |
| 1 // Copyright 2017 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 MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |
| 6 #define MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "media/base/android/android_overlay.h" |
| 10 #include "media/mojo/interfaces/android_overlay.mojom.h" |
| 11 |
| 12 namespace service_manager { |
| 13 namespace mojom { |
| 14 class InterfaceProvider; |
| 15 } |
| 16 } |
| 17 |
| 18 namespace media { |
| 19 |
| 20 class MojoAndroidOverlayClient; |
| 21 |
| 22 // AndroidOverlay implementation via mojo. |
| 23 class MojoAndroidOverlay : public AndroidOverlay { |
| 24 public: |
| 25 MojoAndroidOverlay( |
| 26 service_manager::mojom::InterfaceProvider* interface_provider, |
| 27 int render_frame_id, |
| 28 int renderer_pid, |
| 29 const AndroidOverlay::Config& config); |
| 30 |
| 31 // Testing only. |
| 32 MojoAndroidOverlay(mojom::AndroidOverlayProviderPtr provider_ptr, |
| 33 int render_frame_id, |
| 34 int renderer_pid, |
| 35 const AndroidOverlay::Config& config); |
| 36 |
| 37 ~MojoAndroidOverlay() override; |
| 38 |
| 39 void ScheduleLayout(const gfx::Rect& rect) override; |
| 40 |
| 41 // MojoAndroidOverlayClient callbacks only. |
| 42 public: |
| 43 void OnInitialized(mojom::AndroidOverlayPtr ptr); |
| 44 void OnSurfaceReady(uint32_t surface_key); |
| 45 void OnDestroyed(); |
| 46 |
| 47 private: |
| 48 void Setup(mojom::AndroidOverlayProviderPtr provider_ptr, |
| 49 int render_frame_id, |
| 50 int renderer_pid, |
| 51 const AndroidOverlay::Config& config); |
| 52 service_manager::mojom::InterfaceProvider* interface_provider_; |
| 53 AndroidOverlay::Config config_; |
| 54 mojom::AndroidOverlayProviderPtr provider_ptr_; |
| 55 mojom::AndroidOverlayPtr overlay_ptr_; |
| 56 std::unique_ptr<MojoAndroidOverlayClient> client_; |
| 57 |
| 58 // Have we received OnSurfaceReady yet? |
| 59 bool received_surface_ = false; |
| 60 |
| 61 DISALLOW_COPY_AND_ASSIGN(MojoAndroidOverlay); |
| 62 }; |
| 63 |
| 64 } // namespace media |
| 65 |
| 66 #endif // MEDIA_BASE_MOJO_ANDROID_OVERLAY_H_ |
OLD | NEW |