[feedback] Remove dependency on content::BrowserContext

Instead of having FeedbackUploader take a content::BrowserContext*,
inject the direct dependencies of FeedbackUploader. As creating the
URLLoaderFactory is done lazily, allow injecting a factory (for the
tests) or a callback to create the factory.

This is needed to use //components/feedback on embedders that cannot
use //content such as Chrome on iOS.

Convert the unit tests to not create a TestBrowserContext but
instead directly inject the values (a boolean and a path to a
temporary directory).

Remove setter for the URLLoaderFactory as it can now be injected
at construction time by the tests.

Bug: 1179672
Change-Id: Ic6230013c98b4c03aa85d49086659f635fab1c56
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2707152
Commit-Queue: Sylvain Defresne <sdefresne@chromium.org>
Reviewed-by: Ian Barkley-Yeung <iby@chromium.org>
Cr-Commit-Position: refs/heads/master@{#856604}
GitOrigin-RevId: 23eb1609ec8c1b143c0bed978b29df9c577c8a2f
6 files changed