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

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

Issue 2865653002: [Device Service] Decouple NFC implementation from //content (Closed)
Patch Set: Response to review + fix for tests that don't actually run on bots 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..0ae19b0268845cabd8d5548fa905fb9d9f310e8b 100644
--- a/content/browser/web_contents/web_contents_impl.cc
+++ b/content/browser/web_contents/web_contents_impl.cc
@@ -2642,6 +2642,12 @@ device::mojom::WakeLockService* WebContentsImpl::GetRendererWakeLock() {
return renderer_wake_lock_.get();
}
+void WebContentsImpl::GetNFC(device::nfc::mojom::NFCRequest request) {
+ if (!nfc_host_)
+ nfc_host_.reset(new NFCHost(this));
+ nfc_host_->GetNFC(std::move(request));
+}
+
void WebContentsImpl::OnShowValidationMessage(
RenderViewHostImpl* source,
const gfx::Rect& anchor_in_root_view,
@@ -4332,10 +4338,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