Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1286)

Unified Diff: content/browser/web_contents/web_contents_impl.cc

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Rebase Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/web_contents/web_contents_impl.cc
diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
index 78c9738b52ae24a1ce95b528b64d9b0e92685add..41778bf796aa7223f8ca8e384db023cb4509de19 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2651,6 +2651,14 @@ device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() {
return renderer_wake_lock_.get();
}
+#if defined(OS_ANDROID)
+void WebContentsImpl::GetNFC(device::nfc::mojom::NFCRequest request) {
+ if (!nfc_host_)
+ nfc_host_.reset(new NFCHost(this));
+ nfc_host_->GetNFC(std::move(request));
+}
+#endif
+
void WebContentsImpl::OnShowValidationMessage(
RenderViewHostImpl* source,
const gfx::Rect& anchor_in_root_view,
@@ -4341,10 +4349,6 @@ void WebContentsImpl::RenderFrameCreated(RenderFrameHost* render_frame_host) {
render_frame_host->Send(
new FrameMsg_EnableViewSourceMode(render_frame_host->GetRoutingID()));
}
-#if defined(OS_ANDROID)
- render_frame_host->GetInterfaceRegistry()->AddInterface(
- GetJavaInterfaces()->CreateInterfaceFactory<device::nfc::mojom::NFC>());
-#endif
}
void WebContentsImpl::RenderFrameDeleted(RenderFrameHost* render_frame_host) {
« no previous file with comments | « content/browser/web_contents/web_contents_impl.h ('k') | content/public/android/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698