Set the page size for printing before laying out for print

ResizeForPrinting() used to be called before the page was laid
out for print. This made sense because the size of the webview
has an effect on the way the contents are laid out. In the case of this
bug for example, the width available to the layout depends on the width
of the media thanks to a css query and that determines the number of pages
required to print/preview the doc.

In https://codereview.chromium.org/2089373002 and
https://bugs.chromium.org/p/chromium/issues/detail?id=567317 ResizeForPrinting()
was moved because it was felt this was causing CSS transitions to be triggered
and adversely affecting the layout. 

Unfortunately none of the tests in that bug were successfully automated in the CL
and in manual testing the tests in the CL and the bug now pass regardless of the
position of the ResizeForPrinting() call in StartPrinting().

So this CL reverts crrev.com/2089373002 by moving ResizeForPrinting()
back to where it was since it doesn't appear to have had any positive effect.

Bug: 778837
Change-Id: I492546756266bd1eecf1b5d155c3f3daaed694e7
Reviewed-on: https://chromium-review.googlesource.com/749949
Reviewed-by: Lei Zhang <thestig@chromium.org>
Reviewed-by: nainar <nainar@chromium.org>
Commit-Queue: Robert Hogan <robhogan@gmail.com>
Cr-Commit-Position: refs/heads/master@{#514199}
2 files changed