| 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 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 642 // Because a WebContents can only have one current RVH at a time, there will | 642 // Because a WebContents can only have one current RVH at a time, there will |
| 643 // be no duplicate WebContents here. | 643 // be no duplicate WebContents here. |
| 644 if (indicator->IsCapturingAudio(web_contents)) | 644 if (indicator->IsCapturingAudio(web_contents)) |
| 645 num_tabs_capturing_audio++; | 645 num_tabs_capturing_audio++; |
| 646 if (indicator->IsCapturingVideo(web_contents)) | 646 if (indicator->IsCapturingVideo(web_contents)) |
| 647 num_tabs_capturing_video++; | 647 num_tabs_capturing_video++; |
| 648 if (indicator->IsBeingMirrored(web_contents)) | 648 if (indicator->IsBeingMirrored(web_contents)) |
| 649 num_tabs_capturing_screen++; | 649 num_tabs_capturing_screen++; |
| 650 } | 650 } |
| 651 | 651 |
| 652 ui_->SetAudioCapturingIndicator(num_tabs_capturing_audio > 0); | 652 bool is_capturing_audio = num_tabs_capturing_audio > 0; |
| 653 ui_->SetVideoCapturingIndicator(num_tabs_capturing_video > 0); | 653 bool is_capturing_video = num_tabs_capturing_video > 0; |
| 654 ui_->SetScreenCapturingIndicator(num_tabs_capturing_screen > 0); | 654 bool is_capturing_screen = num_tabs_capturing_screen > 0; |
| 655 if (is_capturing_audio != is_capturing_audio_) { |
| 656 ui_->SetAudioCapturingIndicator(is_capturing_audio); |
| 657 is_capturing_audio_ = is_capturing_audio; |
| 658 } |
| 659 if (is_capturing_video != is_capturing_video_) { |
| 660 ui_->SetVideoCapturingIndicator(is_capturing_video); |
| 661 is_capturing_video_ = is_capturing_video; |
| 662 } |
| 663 if (is_capturing_screen != is_capturing_screen_) { |
| 664 ui_->SetScreenCapturingIndicator(is_capturing_screen); |
| 665 is_capturing_screen_ = is_capturing_screen; |
| 666 } |
| 655 } | 667 } |
| 656 | 668 |
| 657 void VrShell::SetContentCssSize(float width, float height, float dpr) { | 669 void VrShell::SetContentCssSize(float width, float height, float dpr) { |
| 658 JNIEnv* env = base::android::AttachCurrentThread(); | 670 JNIEnv* env = base::android::AttachCurrentThread(); |
| 659 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, | 671 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, |
| 660 dpr); | 672 dpr); |
| 661 } | 673 } |
| 662 | 674 |
| 663 void VrShell::ProcessContentGesture( | 675 void VrShell::ProcessContentGesture( |
| 664 std::unique_ptr<blink::WebInputEvent> event) { | 676 std::unique_ptr<blink::WebInputEvent> event) { |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 715 jlong gvr_api, | 727 jlong gvr_api, |
| 716 jboolean reprojected_rendering) { | 728 jboolean reprojected_rendering) { |
| 717 return reinterpret_cast<intptr_t>(new VrShell( | 729 return reinterpret_cast<intptr_t>(new VrShell( |
| 718 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), | 730 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), |
| 719 for_web_vr, in_cct, | 731 for_web_vr, in_cct, |
| 720 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), | 732 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), |
| 721 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); | 733 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); |
| 722 } | 734 } |
| 723 | 735 |
| 724 } // namespace vr_shell | 736 } // namespace vr_shell |
| OLD | NEW |