Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 gl_thread_->task_runner()->PostTask( |
|
cjgrant
2017/05/16 19:09:27
These calls should go through the ui_ interface.
asimjour1
2017/05/16 20:13:55
Done.
| |
| 555 gl_thread_->GetVrShellGl(), | 555 FROM_HERE, |
| 556 is_capturing_audio)); | 556 base::Bind(&UiSceneManager::SetAudioCapturingIndicator, |
| 557 gl_thread_->GetSceneManager(), is_capturing_audio)); | |
| 558 | |
| 557 is_capturing_audio_ = is_capturing_audio; | 559 is_capturing_audio_ = is_capturing_audio; |
| 558 | 560 |
| 559 bool is_capturing_video = indicator->IsCapturingVideo(web_contents_); | 561 bool is_capturing_video = indicator->IsCapturingVideo(web_contents_); |
| 560 if (is_capturing_video != is_capturing_video_) | 562 if (is_capturing_video != is_capturing_video_) |
| 561 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetVideoCapturingWarning, | 563 gl_thread_->task_runner()->PostTask( |
| 562 gl_thread_->GetVrShellGl(), | 564 FROM_HERE, |
| 563 is_capturing_video)); | 565 base::Bind(&UiSceneManager::SetVideoCapturingIndicator, |
| 566 gl_thread_->GetSceneManager(), is_capturing_video)); | |
| 564 is_capturing_video_ = is_capturing_video; | 567 is_capturing_video_ = is_capturing_video; |
| 565 | 568 |
| 566 bool is_capturing_screen = indicator->IsBeingMirrored(web_contents_); | 569 bool is_capturing_screen = indicator->IsBeingMirrored(web_contents_); |
| 567 if (is_capturing_screen != is_capturing_screen_) | 570 if (is_capturing_screen != is_capturing_screen_) |
| 568 PostToGlThreadWhenReady(base::Bind(&VrShellGl::SetScreenCapturingWarning, | 571 gl_thread_->task_runner()->PostTask( |
| 569 gl_thread_->GetVrShellGl(), | 572 FROM_HERE, |
| 570 is_capturing_screen)); | 573 base::Bind(&UiSceneManager::SetScreenCapturingIndicator, |
| 574 gl_thread_->GetSceneManager(), is_capturing_screen)); | |
| 575 | |
| 571 is_capturing_screen_ = is_capturing_screen; | 576 is_capturing_screen_ = is_capturing_screen; |
| 572 } | 577 } |
| 573 | 578 |
| 574 void VrShell::SetContentCssSize(float width, float height, float dpr) { | 579 void VrShell::SetContentCssSize(float width, float height, float dpr) { |
| 575 JNIEnv* env = base::android::AttachCurrentThread(); | 580 JNIEnv* env = base::android::AttachCurrentThread(); |
| 576 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, | 581 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, |
| 577 dpr); | 582 dpr); |
| 578 } | 583 } |
| 579 | 584 |
| 580 void VrShell::ProcessContentGesture( | 585 void VrShell::ProcessContentGesture( |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 621 jlong gvr_api, | 626 jlong gvr_api, |
| 622 jboolean reprojected_rendering) { | 627 jboolean reprojected_rendering) { |
| 623 return reinterpret_cast<intptr_t>(new VrShell( | 628 return reinterpret_cast<intptr_t>(new VrShell( |
| 624 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 629 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 625 for_web_vr, in_cct, | 630 for_web_vr, in_cct, |
| 626 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 631 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 627 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 632 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 628 } | 633 } |
| 629 | 634 |
| 630 } // namespace vr_shell | 635 } // namespace vr_shell |
| OLD | NEW |