[client-hints] Calculate correct values for viewport width and height on
navigation requests. Currently on navigation requests, the viewport-width and sec-ch-viewport-height client hints are calculated using the display's dimensions. This CL updates the two clients to use the visible viewport size, which provides more accurate information. The CL also handles prefetch requests. In a prefetch request, the frame_tree_node is null, so we need a separate mechanism to track the viewport size. This is done by a new ClientHintsWebContentsObserver. Reimplementation of the reverted CL: https://chromium-review.googlesource.com/c/chromium/src/+/2494876 Bug: 825892 Change-Id: Id3117cfa505c33d59eb7dbb8cc8b485dd567f792 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3108448 Reviewed-by:Avi Drissman <avi@chromium.org> Reviewed-by:
Ryan Sturm <ryansturm@chromium.org> Commit-Queue: Max Curran <curranmax@chromium.org> Cr-Commit-Position: refs/heads/main@{#918864}
Loading