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

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

Issue 2903673002: VR: Update UiSceneManager with screen capturing flag (Closed)
Patch Set: Indicators tests are added. Update the flags only when they change Created 3 years, 6 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 627 matching lines...) Expand 10 before | Expand all | Expand 10 after
638 // Because a WebContents can only have one current RVH at a time, there will 638 // Because a WebContents can only have one current RVH at a time, there will
639 // be no duplicate WebContents here. 639 // be no duplicate WebContents here.
640 if (indicator->IsCapturingAudio(web_contents)) 640 if (indicator->IsCapturingAudio(web_contents))
641 num_tabs_capturing_audio++; 641 num_tabs_capturing_audio++;
642 if (indicator->IsCapturingVideo(web_contents)) 642 if (indicator->IsCapturingVideo(web_contents))
643 num_tabs_capturing_video++; 643 num_tabs_capturing_video++;
644 if (indicator->IsBeingMirrored(web_contents)) 644 if (indicator->IsBeingMirrored(web_contents))
645 num_tabs_capturing_screen++; 645 num_tabs_capturing_screen++;
646 } 646 }
647 647
648 ui_->SetAudioCapturingIndicator(num_tabs_capturing_audio > 0); 648 bool is_capturing_audio = num_tabs_capturing_audio > 0;
649 ui_->SetVideoCapturingIndicator(num_tabs_capturing_video > 0); 649 bool is_capturing_video = num_tabs_capturing_video > 0;
650 ui_->SetScreenCapturingIndicator(num_tabs_capturing_screen > 0); 650 bool is_capturing_screen = num_tabs_capturing_screen > 0;
651 if (is_capturing_audio != is_capturing_audio_) {
652 ui_->SetAudioCapturingIndicator(is_capturing_audio);
653 is_capturing_audio_ = is_capturing_audio;
654 }
655 if (is_capturing_video != is_capturing_video_) {
656 ui_->SetVideoCapturingIndicator(is_capturing_video);
657 is_capturing_video_ = is_capturing_video;
658 }
659 if (is_capturing_screen != is_capturing_screen_) {
660 ui_->SetScreenCapturingIndicator(is_capturing_screen);
661 is_capturing_screen_ = is_capturing_screen;
662 }
651 } 663 }
652 664
653 void VrShell::SetContentCssSize(float width, float height, float dpr) { 665 void VrShell::SetContentCssSize(float width, float height, float dpr) {
654 JNIEnv* env = base::android::AttachCurrentThread(); 666 JNIEnv* env = base::android::AttachCurrentThread();
655 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height, 667 Java_VrShellImpl_setContentCssSize(env, j_vr_shell_.obj(), width, height,
656 dpr); 668 dpr);
657 } 669 }
658 670
659 void VrShell::ProcessContentGesture( 671 void VrShell::ProcessContentGesture(
660 std::unique_ptr<blink::WebInputEvent> event) { 672 std::unique_ptr<blink::WebInputEvent> event) {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
711 jlong gvr_api, 723 jlong gvr_api,
712 jboolean reprojected_rendering) { 724 jboolean reprojected_rendering) {
713 return reinterpret_cast<intptr_t>(new VrShell( 725 return reinterpret_cast<intptr_t>(new VrShell(
714 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android), 726 env, obj, reinterpret_cast<ui::WindowAndroid*>(window_android),
715 for_web_vr, in_cct, 727 for_web_vr, in_cct,
716 VrShellDelegate::GetNativeVrShellDelegate(env, delegate), 728 VrShellDelegate::GetNativeVrShellDelegate(env, delegate),
717 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering)); 729 reinterpret_cast<gvr_context*>(gvr_api), reprojected_rendering));
718 } 730 }
719 731
720 } // namespace vr_shell 732 } // namespace vr_shell
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698