Move page scale factor out of RenderWidget::SynchronizeVisualProperties.

The SynchronizeVisualProperties() method is called from the IPC handler
to apply some of the IPC message. The code for page scale factor is
moved out to the IPC handler to act on it directly.

It is also called by a number of methods for tests, which apply various
properties to the RenderWidget. Page scale is not ever changed by these
test methods, so they do not depend on it being inside

It is also also called from the screen metrics emulator, but since the
emulator does not change the page scale factor, it also does not depend
on this code being in SynchronizeVisualProperties().

The notification of the page scale factor change to each
RenderFrameProxy is dramatically reordered with respect to the other
properties of RenderWidget changing. This is okay because the
notification is only to pass the value over IPC up to the browser and
down to the child RenderWidget, so it does not depend on the ordering.

This reduces the test-only method dependency footprint on the
VisualProperties structure. Left a TODO about changing the routing
of this page scale property to go

blink->RenderView->RenderViewHost->{All RenderWidgets}

instead of the current

  {All RenderFrameProxy->RenderWidgetHost->RenderWidgets}

Other page-level properties could benefit from this path as well
but are much trickier since they
a) do not go through RenderFrameProxy today and instead seem to
propagate through the browser code, which is good, except
b) are treated identically in child RenderWidgets as in the main

whereas the page scale factor has clear behaviour differences for
child RenderWidgets. So this could be useful for exploring and
establishing this pattern.

Change-Id: I4af9b114e729c26e8356e69ecb9569337d653cb3
Bug: 912193
Commit-Queue: danakj <>
Reviewed-by: Albert J. Wong <>
Cr-Commit-Position: refs/heads/master@{#625401}
2 files changed