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

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

Issue 2890563003: VR: Update UiSceneManager with audio/video capturing flags (Closed)
Patch Set: Use ui_ in VrShell Created 3 years, 7 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
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 <android/native_window_jni.h> 7 #include <android/native_window_jni.h>
8 8
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after
544 base::Bind(&VrShell::PollMediaAccessFlag, base::Unretained(this))); 544 base::Bind(&VrShell::PollMediaAccessFlag, base::Unretained(this)));
545 main_thread_task_runner_->PostDelayedTask( 545 main_thread_task_runner_->PostDelayedTask(
546 FROM_HERE, poll_capturing_media_task_.callback(), 546 FROM_HERE, poll_capturing_media_task_.callback(),
547 poll_media_access_interval_); 547 poll_media_access_interval_);
548 548
549 scoped_refptr<MediaStreamCaptureIndicator> indicator = 549 scoped_refptr<MediaStreamCaptureIndicator> indicator =
550 MediaCaptureDevicesDispatcher::GetInstance() 550 MediaCaptureDevicesDispatcher::GetInstance()
551 ->GetMediaStreamCaptureIndicator(); 551 ->GetMediaStreamCaptureIndicator();
552 bool is_capturing_audio = indicator->IsCapturingAudio(web_contents_); 552 bool is_capturing_audio = indicator->IsCapturingAudio(web_contents_);
553 if (is_capturing_audio != is_capturing_audio_) 553 if (is_capturing_audio != is_capturing_audio_)
554 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetAudioCapturingWarning, 554 ui_->SetAudioCapturingIndicator(is_capturing_audio);
555 gl_thread_->GetVrShellGl(),
556 is_capturing_audio));
557 is_capturing_audio_ = is_capturing_audio; 555 is_capturing_audio_ = is_capturing_audio;
558 556
559 bool is_capturing_video = indicator->IsCapturingVideo(web_contents_); 557 bool is_capturing_video = indicator->IsCapturingVideo(web_contents_);
560 if (is_capturing_video != is_capturing_video_) 558 if (is_capturing_video != is_capturing_video_)
561 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetVideoCapturingWarning, 559 ui_->SetVideoCapturingIndicator(is_capturing_video);
562 gl_thread_->GetVrShellGl(),
563 is_capturing_video));
564 is_capturing_video_ = is_capturing_video; 560 is_capturing_video_ = is_capturing_video;
565 561
566 bool is_capturing_screen = indicator->IsBeingMirrored(web_contents_); 562 bool is_capturing_screen = indicator->IsBeingMirrored(web_contents_);
567 if (is_capturing_screen != is_capturing_screen_) 563 if (is_capturing_screen != is_capturing_screen_)
568 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetScreenCapturingWarning, 564 ui_->SetScreenCapturingIndicator(is_capturing_screen);
569 gl_thread_->GetVrShellGl(),
570 is_capturing_screen));
571 is_capturing_screen_ = is_capturing_screen; 565 is_capturing_screen_ = is_capturing_screen;
572 } 566 }
573 567
574 void VrShell::SetContentCssSize(float width, float height, float dpr) { 568 void VrShell::SetContentCssSize(float width, float height, float dpr) {
575 JNIEnv* env = base::android::AttachCurrentThread(); 569 JNIEnv* env = base::android::AttachCurrentThread();
576 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, 570 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height,
577 dpr); 571 dpr);
578 } 572 }
579 573
580 void VrShell::ProcessContentGesture( 574 void VrShell::ProcessContentGesture(
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
621 jlong gvr_api, 615 jlong gvr_api,
622 jboolean reprojected_rendering) { 616 jboolean reprojected_rendering) {
623 return reinterpret_cast<intptr_t>(new VrShell( 617 return reinterpret_cast<intptr_t>(new VrShell(
624 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), 618 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
625 for_web_vr, in_cct, 619 for_web_vr, in_cct,
626 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 620 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
627 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 621 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
628 } 622 }
629 623
630 } // namespace vr_shell 624 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698