| Index: chrome/browser/android/vr_shell/vr_shell.cc
|
| diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
|
| index ccff37fc607841bfdc5032bd1adea5edfd7be7b4..dc377441b7a4f1ee0625c52ca1620161751f21e3 100644
|
| --- a/chrome/browser/android/vr_shell/vr_shell.cc
|
| +++ b/chrome/browser/android/vr_shell/vr_shell.cc
|
| @@ -19,6 +19,7 @@
|
| #include "chrome/browser/android/vr_shell/vr_shell_gl.h"
|
| #include "chrome/browser/android/vr_shell/vr_usage_monitor.h"
|
| #include "chrome/browser/android/vr_shell/vr_web_contents_observer.h"
|
| +#include "content/public/browser/android/video_surface_manager.h"
|
| #include "content/public/browser/navigation_controller.h"
|
| #include "content/public/browser/render_view_host.h"
|
| #include "content/public/browser/render_widget_host.h"
|
| @@ -150,9 +151,13 @@ VrShell::VrShell(JNIEnv* env,
|
| main_contents, html_interface_.get(), this));
|
|
|
| SetShowingOverscrollGlow(false);
|
| + content::VideoSurfaceManager::GetInstance()->
|
| + SetOverrideVideoSurfaceProvider(this);
|
| }
|
|
|
| void VrShell::Destroy(JNIEnv* env, const JavaParamRef<jobject>& obj) {
|
| + content::VideoSurfaceManager::GetInstance()->
|
| + RemoveOverrideVideoSurfaceProvider(this);
|
| delete this;
|
| }
|
|
|
| @@ -463,6 +468,25 @@ void VrShell::SetUiCssSize(float width, float height, float dpr) {
|
| Java_VrShellImpl_setUiCssSize(env, j_vr_shell_.obj(), width, height, dpr);
|
| }
|
|
|
| +void VrShell::OnVideoSizeChanged(int width, int height) {
|
| + // TODO(amp): Do something intelligent with the size.
|
| +}
|
| +
|
| +void VrShell::CreateVideoSurface(content::VideoSurfaceProvider::Client* client,
|
| + const gfx::Size& video_natural_size) {
|
| + client_ = client;
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + Java_VrShellImpl_createVideoSurface(env, j_vr_shell_.obj());
|
| + // TODO(amp): Use the natural size somehow.
|
| +}
|
| +
|
| +void VrShell::SetVideoSurface(JNIEnv*,
|
| + const JavaParamRef<jobject>&,
|
| + const JavaParamRef<jobject>& surface) {
|
| + client_->SetVideoSurface(
|
| + gl::ScopedJavaSurface::AcquireExternalSurface(surface));
|
| +}
|
| +
|
| // ----------------------------------------------------------------------------
|
| // Native JNI methods
|
| // ----------------------------------------------------------------------------
|
|
|