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

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

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Response to reviews 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
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 6cee92c3e57c1e88a42edff7fcc9c039c79da5c0..016ba53c906d34e228751322235bf8eb853f442e 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2642,6 +2642,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,
@@ -4332,10 +4340,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) {

Powered by Google App Engine
This is Rietveld 408576698