Screen Enumeration: Add screen change event
Add 'onscreenschange' global event when ScreenEnumeration is enabled.
Add ScreenChangeMonitor helper class to observe screen change events.
WebContentsImpl uses this to notify RenderFrameHostImpls on changes.
Use blink::mojom::LocalFrame to dispatch kScreensChange on DOMWindow.
Add content_browsertest fixtures for getScreens() and onscreenschange.
TODO(crbug.com/1068774): Send screen info with the event.
TODO(crbug.com/1071233): Investigate test failures/crashes on Fuchsia.
This requires the ScreenEnumeration experimental flag to be enabled:
chrome://flags#enable-experimental-web-platform-features OR
$ chrome --enable-blink-features=ScreenEnumeration
Try with: https://github.com/michaelwasserman/window-placement-demo
Bug: 994889
Test: Automated, demo w/flags and manual system screen config changes
Change-Id: Ib601245bfe0533f2dee5573b9c302f2bb08a6c12
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1986234
Commit-Queue: Michael Wasserman <[email protected]>
Reviewed-by: Daniel Cheng <[email protected]>
Reviewed-by: enne <[email protected]>
Reviewed-by: danakj <[email protected]>
Reviewed-by: John Abd-El-Malek <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Cr-Commit-Position: refs/heads/master@{#759479}
diff --git a/content/browser/BUILD.gn b/content/browser/BUILD.gn
index ad77d862..794cee9 100644
--- a/content/browser/BUILD.gn
+++ b/content/browser/BUILD.gn
@@ -1637,6 +1637,8 @@
"scheduler/responsiveness/watcher.h",
"scoped_active_url.cc",
"scoped_active_url.h",
+ "screen_enumeration/screen_change_monitor.cc",
+ "screen_enumeration/screen_change_monitor.h",
"screen_enumeration/screen_enumeration_impl.cc",
"screen_enumeration/screen_enumeration_impl.h",
"screen_orientation/screen_orientation_provider.cc",