Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(442)

Side by Side Diff: chrome/browser/android/vr_shell/vr_shell.cc

Issue 2361533003: Expose secure origin state to WebVR renderer (Closed)
Patch Set: Rebase Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | device/vr/android/gvr/gvr_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_shell.h" 5 #include "chrome/browser/android/vr_shell/vr_shell.h"
6 6
7 #include <thread> 7 #include <thread>
8 8
9 #include "chrome/browser/android/vr_shell/ui_scene.h" 9 #include "chrome/browser/android/vr_shell/ui_scene.h"
10 #include "chrome/browser/android/vr_shell/vr_compositor.h" 10 #include "chrome/browser/android/vr_shell/vr_compositor.h"
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 glDepthMask(GL_FALSE); 376 glDepthMask(GL_FALSE);
377 glDisable(GL_DEPTH_TEST); 377 glDisable(GL_DEPTH_TEST);
378 glDisable(GL_SCISSOR_TEST); 378 glDisable(GL_SCISSOR_TEST);
379 glDisable(GL_BLEND); 379 glDisable(GL_BLEND);
380 glDisable(GL_POLYGON_OFFSET_FILL); 380 glDisable(GL_POLYGON_OFFSET_FILL);
381 381
382 // Don't need to clear, since we're drawing over the entire render target. 382 // Don't need to clear, since we're drawing over the entire render target.
383 383
384 glViewport(0, 0, render_size_.width, render_size_.height); 384 glViewport(0, 0, render_size_.width, render_size_.height);
385 vr_shell_renderer_->GetWebVrRenderer()->Draw(content_texture_id_); 385 vr_shell_renderer_->GetWebVrRenderer()->Draw(content_texture_id_);
386
387 if (!webvr_secure_origin_) {
388 // TODO(klausw): Draw the insecure origin warning here.
389 }
386 } 390 }
387 391
388 void VrShell::OnPause(JNIEnv* env, const JavaParamRef<jobject>& obj) { 392 void VrShell::OnPause(JNIEnv* env, const JavaParamRef<jobject>& obj) {
389 if (gvr_api_ == nullptr) 393 if (gvr_api_ == nullptr)
390 return; 394 return;
391 gvr_api_->PauseTracking(); 395 gvr_api_->PauseTracking();
392 } 396 }
393 397
394 void VrShell::OnResume(JNIEnv* env, const JavaParamRef<jobject>& obj) { 398 void VrShell::OnResume(JNIEnv* env, const JavaParamRef<jobject>& obj) {
395 if (gvr_api_ == nullptr) 399 if (gvr_api_ == nullptr)
396 return; 400 return;
397 401
398 gvr_api_->RefreshViewerProfile(); 402 gvr_api_->RefreshViewerProfile();
399 gvr_api_->ResumeTracking(); 403 gvr_api_->ResumeTracking();
400 } 404 }
401 405
402 void VrShell::SetWebVrMode(JNIEnv* env, 406 void VrShell::SetWebVrMode(JNIEnv* env,
403 const base::android::JavaParamRef<jobject>& obj, 407 const base::android::JavaParamRef<jobject>& obj,
404 bool enabled) { 408 bool enabled) {
405 webvr_mode_ = enabled; 409 webvr_mode_ = enabled;
406 } 410 }
407 411
412 void VrShell::SetWebVRSecureOrigin(bool secure_origin) {
413 webvr_secure_origin_ = secure_origin;
414 }
415
408 void VrShell::SubmitWebVRFrame() { 416 void VrShell::SubmitWebVRFrame() {
409 } 417 }
410 418
411 void VrShell::UpdateWebVRTextureBounds( 419 void VrShell::UpdateWebVRTextureBounds(
412 int eye, float left, float top, float width, float height) { 420 int eye, float left, float top, float width, float height) {
413 gvr::Rectf bounds = { left, top, width, height }; 421 gvr::Rectf bounds = { left, top, width, height };
414 vr_shell_renderer_->GetWebVrRenderer()->UpdateTextureBounds(eye, bounds); 422 vr_shell_renderer_->GetWebVrRenderer()->UpdateTextureBounds(eye, bounds);
415 } 423 }
416 424
417 gvr::GvrApi* VrShell::gvr_api() { 425 gvr::GvrApi* VrShell::gvr_api() {
(...skipping 22 matching lines...) Expand all
440 const JavaParamRef<jobject>& content_web_contents, 448 const JavaParamRef<jobject>& content_web_contents,
441 jlong content_window_android) { 449 jlong content_window_android) {
442 content::ContentViewCore* c_core = content::ContentViewCore::FromWebContents( 450 content::ContentViewCore* c_core = content::ContentViewCore::FromWebContents(
443 content::WebContents::FromJavaWebContents(content_web_contents)); 451 content::WebContents::FromJavaWebContents(content_web_contents));
444 return reinterpret_cast<intptr_t>(new VrShell( 452 return reinterpret_cast<intptr_t>(new VrShell(
445 env, obj, c_core, 453 env, obj, c_core,
446 reinterpret_cast<ui::WindowAndroid*>(content_window_android))); 454 reinterpret_cast<ui::WindowAndroid*>(content_window_android)));
447 } 455 }
448 456
449 } // namespace vr_shell 457 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_shell.h ('k') | device/vr/android/gvr/gvr_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698