ContentCapture: Add OnscreenContentProvider

This patch is 3rd patch of the refactoring, it has below changes
- ContentCaptureConsumer became a interface, it stops to handle the
  WebContents change.
- Rename ContentCaptureConsumerImpl to PlatformContentCaptureConsumer.
- Rename ContentCaptureReceiverManager to OnscreenContentProvider.
- OnscreenContentProvider adds PlatformContentCaptureConsumer and
  ExperimentContentCaptureConsumer as needed, so each embedder's
  interaction to ContentCapture becomes simple.
- The onscreen content streaming won't start if there is no
  consumer.
- OnscreenContentProvider handles the WebContents change, it creates
  native ContentCaptureReceiverManagerAndroid as needed and switches
  to current WebContents by removing/adding itself as consumer.
- ContentCaptureReceiverManagerAndroid as a native consumer is owned
  by OnscreenContentProvider, it forwards the contentcapture events
  to OnscreenContentProvider and does the actual consumer switch.
  It will be renamed to OnscreenContentProviderAndroid in next patch.

No new test, all cases shall already be covered by existing tests.

Bug: 1191672, 1119663
Change-Id: I83533884f1bd4527c71a2dd612a709429c729ee5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2794728
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Colin Blundell <blundell@chromium.org>
Reviewed-by: David Trainor <dtrainor@chromium.org>
Reviewed-by: Michael Bai <michaelbai@chromium.org>
Commit-Queue: Michael Bai <michaelbai@chromium.org>
Cr-Commit-Position: refs/heads/master@{#868120}
GitOrigin-RevId: 89355e68e63313d9866c363a385031077c8b3e7c
diff --git a/java/src/com/android/webview/chromium/WebViewChromium.java b/java/src/com/android/webview/chromium/WebViewChromium.java
index adf74cb..e667305 100644
--- a/java/src/com/android/webview/chromium/WebViewChromium.java
+++ b/java/src/com/android/webview/chromium/WebViewChromium.java
@@ -68,8 +68,8 @@
 import org.chromium.base.metrics.RecordHistogram;
 import org.chromium.base.metrics.ScopedSysTraceEvent;
 import org.chromium.components.autofill.AutofillProvider;
-import org.chromium.components.content_capture.ContentCaptureConsumerImpl;
 import org.chromium.components.content_capture.ContentCaptureFeatures;
+import org.chromium.components.content_capture.OnscreenContentProvider;
 import org.chromium.components.embedder_support.application.ClassLoaderContextWrapperFactory;
 import org.chromium.content_public.browser.NavigationHistory;
 import org.chromium.content_public.browser.SmartClipProvider;
@@ -1832,7 +1832,7 @@
         if (ContentCaptureFeatures.isDumpForTestingEnabled()) {
             Log.i("ContentCapture", "onProvideContentCaptureStructure");
         }
-        mAwContents.setContentCaptureConsumer(ContentCaptureConsumerImpl.create(
+        mAwContents.setOnscreenContentProvider(new OnscreenContentProvider(
                 ClassLoaderContextWrapperFactory.get(mWebView.getContext()), mWebView, structure,
                 mAwContents.getWebContents()));
     }