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

Unified Diff: content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java

Issue 2692023002: Make PaymentRequestImpl work with RenderFrameHost (Closed)
Patch Set: Address review comment Created 3 years, 9 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/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java
diff --git a/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java b/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java
index 45b3ffe0f44d27d09f35fc5521ddc5c49f516012..131260b41b5413ba3e3b0c3d611cec48e3d5aeee 100644
--- a/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java
+++ b/content/public/android/java/src/org/chromium/content_public/browser/InterfaceRegistrar.java
@@ -25,6 +25,7 @@ public interface InterfaceRegistrar<ParamType> {
public static class Registry<ParamType> {
private static Registry<Context> sContextRegistry;
private static Registry<WebContents> sWebContentsRegistry;
+ private static Registry<RenderFrameHost> sRenderFrameHostRegistry;
private List<InterfaceRegistrar<ParamType>> mRegistrars =
new ArrayList<InterfaceRegistrar<ParamType>>();
@@ -45,6 +46,14 @@ public interface InterfaceRegistrar<ParamType> {
sWebContentsRegistry.applyRegistrars(interfaceRegistry, webContents);
}
+ public static void applyRenderFrameHostRegistrars(
+ InterfaceRegistry interfaceRegistry, RenderFrameHost renderFrameHost) {
+ if (sRenderFrameHostRegistry == null) {
+ return;
+ }
+ sRenderFrameHostRegistry.applyRegistrars(interfaceRegistry, renderFrameHost);
+ }
+
public static void addContextRegistrar(InterfaceRegistrar<Context> registrar) {
if (sContextRegistry == null) {
sContextRegistry = new Registry<Context>();
@@ -59,6 +68,14 @@ public interface InterfaceRegistrar<ParamType> {
sWebContentsRegistry.addRegistrar(registrar);
}
+ public static void addRenderFrameHostRegistrar(
+ InterfaceRegistrar<RenderFrameHost> registrar) {
+ if (sRenderFrameHostRegistry == null) {
+ sRenderFrameHostRegistry = new Registry<RenderFrameHost>();
+ }
+ sRenderFrameHostRegistry.addRegistrar(registrar);
+ }
+
private Registry() {}
private void addRegistrar(InterfaceRegistrar<ParamType> registrar) {

Powered by Google App Engine
This is Rietveld 408576698