Chromium Code Reviews| Index: content/browser/media/android/browser_surface_view_manager.h |
| diff --git a/content/browser/media/android/browser_surface_view_manager.h b/content/browser/media/android/browser_surface_view_manager.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..4d71eb62eb2bd9e97f493f8603aff116815ed720 |
| --- /dev/null |
| +++ b/content/browser/media/android/browser_surface_view_manager.h |
| @@ -0,0 +1,50 @@ |
| +// 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 CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| +#define CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |
| + |
| +#include <stdint.h> |
| + |
| +#include "base/macros.h" |
| +#include "base/memory/scoped_ptr.h" |
| +#include "content/browser/android/content_video_view.h" |
| +#include "content/common/content_export.h" |
| +#include "ui/gfx/geometry/size.h" |
| + |
| +namespace content { |
| + |
| +class RenderFrameHost; |
| + |
| +// BrowserSurfaceViewManager creates and owns a ContentVideoView on behalf of |
| +// a fullscreen media player. Its SurfaceView is registered so that a decoder |
| +// in the GPU process can look it up and render to it. |
| +class CONTENT_EXPORT BrowserSurfaceViewManager |
| + : public ContentVideoView::Client { |
| + public: |
| + explicit BrowserSurfaceViewManager(RenderFrameHost* render_frame_host); |
| + |
| + // ContentVideoView::Client overrides. |
| + void SetVideoSurface(gfx::ScopedJavaSurface surface) override; |
| + void DidExitFullscreen(bool release_media_player) override; |
| + |
| + void OnCreateFullscreenSurface(gfx::Size video_size); |
|
DaleCurtis
2016/02/06 00:17:39
Should we pass these by const& ?
watk
2016/02/11 23:03:25
Done.
|
| + void OnFullscreenVideoSizeChanged(gfx::Size size); |
| + |
| + private: |
| + // Send a message to return the surface id to the caller. |
| + bool SendSurfaceID(int surface_id); |
| + |
| + RenderFrameHost* const render_frame_host_; |
| + // The surface id of the ContentVideoView surface. |
|
DaleCurtis
2016/02/06 00:17:39
Blank lines between comment and previous code.
watk
2016/02/11 23:03:25
Done.
|
| + int surface_id_; |
| + // The fullscreen view that contains a SurfaceView. |
| + scoped_ptr<ContentVideoView> content_video_view_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(BrowserSurfaceViewManager); |
| +}; |
| + |
| +} // namespace content |
| + |
| +#endif // CONTENT_BROWSER_MEDIA_ANDROID_BROWSER_SURFACE_VIEW_MANAGER_H_ |