[LocationDelegation] Delegate location data from TWA

This CL adds the ability of delegation geolocation data from TWA.

If runningTWA (and location delegation enabled), GeolocationServiceImpl
will bind the geolocation via installed_webapp_context instead of the
geolocation_context_ in services/device/

For each new binding, InstalledWebappGeolocationContext will create an
InstalledWebappGeolocationBridge. the "bridge" class is a impl of the
device::mojom::Geolocation mojo interface. It's similar to
services/device/geolocation/geolocation_impl.cc
The bridge class also serve as jni that connect with the java part.
The java part is adding in following CL: crrev.com/c/2212455.


Detail see design doc:
https://docs.google.com/document/d/1oWZmJBXL2m_XqiJs6gDNzyky5mDml28b0LO6CQ5kFfE/edit

Change-Id: I2e83d7f620f2d202b4bc77d0b04d876a032adaf5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2210487
Commit-Queue: Ella Ge <[email protected]>
Reviewed-by: Peter Conn <[email protected]>
Reviewed-by: Yaron Friedman <[email protected]>
Reviewed-by: Dominick Ng <[email protected]>
Reviewed-by: Reilly Grant <[email protected]>
Cr-Commit-Position: refs/heads/master@{#775588}
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 4fdf8cf..3e55f2ee 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -3410,6 +3410,13 @@
 }
 
 device::mojom::GeolocationContext* WebContentsImpl::GetGeolocationContext() {
+  if (delegate_) {
+    auto* installed_webapp_context =
+        delegate_->GetInstalledWebappGeolocationContext();
+    if (installed_webapp_context)
+      return installed_webapp_context;
+  }
+
   if (!geolocation_context_) {
     GetDeviceService().BindGeolocationContext(
         geolocation_context_.BindNewPipeAndPassReceiver());