Skip to content
Commit 97d6e9c1 authored by Elad Alon's avatar Elad Alon Committed by Chromium LUCI CQ
Browse files

[Conditional Focus][#1] Expose focus logic

Design doc:
https://docs.google.com/document/d/1cfxcOfNVCgIzZM_yV6KGZSeU1rMrDbYP_RtOSvfQ8zI/edit?usp=sharing&resourcekey=0-4wB76nSgpLEbt1P8OWCcsg

Background:
Conditional Focus allows a called to getDisplayMedia() to decide
whether the captured display surface (tab/window) should be focused.
There is a window of 1s during which focus can be triggered or
suppressed. If the application does not explicitly decide within
the allotted time, the captured display surface IS focused,
in line with previous behavior.

This CL:
Previously, the logic for focusing was hard-coded deep inside the UI.
Now, the logic for focusing is exposed to MediaStreamManager. From here
future CLs in this chain can trigger the logic with ease, going from
Blink to MediaStreamDispatcherHost and then finally to MSM.

Note:
This CL does not introduce any new unit-tests or browser-tests.
It's easier to check this feature once all parts are landed.
This is safe because everything is gated by a command-line flag
and is no-op so long as the command-line flag is not provided.

Next CLs, in order:
1. Expose the API in Blink.
2. Add a microtask to close the focus-window when finishing the task
   on which the Promise<MediaStream> was resolved, even if 1s has
   not yet elapsed.
3. Add browser tests.
4. Remove the browser-side command-line flag.
5. Change the Blink feature-gating to OT-gating.

Bug: 1215480
Change-Id: I4eabd8c45f7ea868ba23e90e9adb6f7646f9770c
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3107189


Auto-Submit: Elad Alon <eladalon@chromium.org>
Commit-Queue: Yaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarYaron Friedman <yfriedman@chromium.org>
Reviewed-by: default avatarmark a. foltz <mfoltz@chromium.org>
Reviewed-by: default avatarKinuko Yasuda <kinuko@chromium.org>
Reviewed-by: default avatarAlexander Alekseev <alemate@chromium.org>
Reviewed-by: default avatarThomas Guilbert <tguilbert@chromium.org>
Reviewed-by: default avatarHenrik Boström <hbos@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/main@{#915940}
parent 760c3152
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment