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

Unified 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, 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/vr_shell.cc
diff --git a/chrome/browser/android/vr_shell/vr_shell.cc b/chrome/browser/android/vr_shell/vr_shell.cc
index 13ab589b1e10a6f2993ce3b085fcbf0776d51df3..5a7be6589489881e3cbf47642b854a59b9b20a83 100644
--- a/chrome/browser/android/vr_shell/vr_shell.cc
+++ b/chrome/browser/android/vr_shell/vr_shell.cc
@@ -645,9 +645,21 @@ void VrShell::PollMediaAccessFlag() {
num_tabs_capturing_screen++;
}
- ui_->SetAudioCapturingIndicator(num_tabs_capturing_audio > 0);
- ui_->SetVideoCapturingIndicator(num_tabs_capturing_video > 0);
- ui_->SetScreenCapturingIndicator(num_tabs_capturing_screen > 0);
+ bool is_capturing_audio = num_tabs_capturing_audio > 0;
+ bool is_capturing_video = num_tabs_capturing_video > 0;
+ bool is_capturing_screen = num_tabs_capturing_screen > 0;
+ if (is_capturing_audio != is_capturing_audio_) {
+ ui_->SetAudioCapturingIndicator(is_capturing_audio);
+ is_capturing_audio_ = is_capturing_audio;
+ }
+ if (is_capturing_video != is_capturing_video_) {
+ ui_->SetVideoCapturingIndicator(is_capturing_video);
+ is_capturing_video_ = is_capturing_video;
+ }
+ if (is_capturing_screen != is_capturing_screen_) {
+ ui_->SetScreenCapturingIndicator(is_capturing_screen);
+ is_capturing_screen_ = is_capturing_screen;
+ }
}
void VrShell::SetContentCssSize(float width, float height, float dpr) {

Powered by Google App Engine
This is Rietveld 408576698