OLD | NEW |
(Empty) | |
| 1 // Copyright 2016 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 CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_SURFACE_VIEW_MANAGER_H_ |
| 6 #define CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_SURFACE_VIEW_MANAGER_H_ |
| 7 |
| 8 #include "base/callback.h" |
| 9 #include "content/common/content_export.h" |
| 10 #include "content/public/renderer/render_frame_observer.h" |
| 11 #include "media/base/surface_manager.h" |
| 12 #include "ui/gfx/geometry/size.h" |
| 13 |
| 14 namespace content { |
| 15 |
| 16 // RendererSurfaceViewManager creates delegates requests for video SurfaceViews |
| 17 // to BrowserSurfaceViewManager. The returned surface ids may be invalidated |
| 18 // at any time (e.g., when the app is backgrounded), so clients should handle |
| 19 // this gracefully. It should be created and used on a single thread only. |
| 20 class CONTENT_EXPORT RendererSurfaceViewManager : public media::SurfaceManager, |
| 21 public RenderFrameObserver { |
| 22 public: |
| 23 explicit RendererSurfaceViewManager(RenderFrame* render_frame); |
| 24 ~RendererSurfaceViewManager() override; |
| 25 |
| 26 // RenderFrameObserver override. |
| 27 bool OnMessageReceived(const IPC::Message& msg) override; |
| 28 |
| 29 // SurfaceManager overrides. |
| 30 void CreateFullscreenSurface( |
| 31 const gfx::Size& video_natural_size, |
| 32 const media::SurfaceCreatedCB& surface_created_cb) override; |
| 33 void NaturalSizeChanged(const gfx::Size& size) override; |
| 34 |
| 35 private: |
| 36 void OnFullscreenSurfaceCreated(int surface_id); |
| 37 |
| 38 // Set when a surface request is in progress. |
| 39 media::SurfaceCreatedCB pending_surface_created_cb_; |
| 40 |
| 41 DISALLOW_COPY_AND_ASSIGN(RendererSurfaceViewManager); |
| 42 }; |
| 43 |
| 44 } // namespace content |
| 45 |
| 46 #endif // CONTENT_RENDERER_MEDIA_ANDROID_RENDERER_SURFACE_VIEW_MANAGER_H_ |
OLD | NEW |