Initialize RenderWidget(Host)(View)s with correct visibility state

Currently, newly constructed RenderWidget(Host|View)*s assume they are
visible until they are notified otherwise. We've had a long list of bugs
where widgets created in the background would not receive any hidden
notification and would continue to operate as if they were visible. For
examples see bugs 118269, 142061, 155365 and 272962.

This makes the visibility of a widget a construction-time parameter and
sets the correct state at construction sites. Most widgets are created
to be visible. Notable exceptions are swapped-out widgets and widgets
created for background navigations. The initial widget visibility state is
passed down to the render process so the content::RenderWidget and Blink
have the correct state from the start.

RenderViewHostManager is a bit tricky since it can construct new
RenderViewHost instances on the fly due to navigation. This patch
adds a bool IsHidden function to RVHManager::Delegate so the manager
can ask the WebContentsImpl for the correct initial state.

BUG=20831, 155365, 272962

Review URL: https://chromiumcodereview.appspot.com/23129015

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@218548 0039d316-1c4b-4281-b951-d872f2087c98
37 files changed