BrowserWebStateListDelegate is responsible for the creation of the
tab helpers attached to all the WebStates for a given Browser. The
tab helpers may have indirect dependencies on BrowserList.
To prevent such a cycle to appear, introduce a factory to inject
the WebStateListDelegate passed to the BrowserList, and split the
target that define the BrowserList implementation and the factory.
Convert BrowserList to a KeyedService to use the infrastructure
to ensure the WebStateListDelegate injection happens at the correct
time, and fix all uses of BrowserList::FromBrowserState() to use
the factory instead.
Bug: 761537
Change-Id: I5a16571abb695bf5b76fc7e58a689ad7b93abd36
Reviewed-on: https://chromium-review.googlesource.com/649612
Commit-Queue: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: Kurt Horimoto <kkhorimoto@chromium.org>
Reviewed-by: Eric Noyau <noyau@chromium.org>
Cr-Commit-Position: refs/heads/master@{#500104}