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

Unified Diff: content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java

Issue 2688193002: Mojo framework for AndroidOverlay. (Closed)
Patch Set: cl comments, refactored MojoAndroidOverlay to inherit from mojom:... Created 3 years, 10 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/browser/androidoverlay/AndroidOverlayProviderImpl.java
diff --git a/content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java b/content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java
new file mode 100644
index 0000000000000000000000000000000000000000..e9fd257c0c720d3cdfc1666e096089881ee138ec
--- /dev/null
+++ b/content/public/android/java/src/org/chromium/content/browser/androidoverlay/AndroidOverlayProviderImpl.java
@@ -0,0 +1,49 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+package org.chromium.content.browser.androidoverlay;
+
+import android.content.Context;
+
+import org.chromium.media.mojom.AndroidOverlayClient;
+import org.chromium.media.mojom.AndroidOverlayConfig;
+import org.chromium.media.mojom.AndroidOverlayProvider;
+import org.chromium.mojo.system.MojoException;
+import org.chromium.services.service_manager.InterfaceFactory;
+
+/**
+ * Default impl of AndroidOverlayProvider. Creates AndroidOverlayImpls.
+ */
+public class AndroidOverlayProviderImpl implements AndroidOverlayProvider {
+ private static final String TAG = "AndroidOverlayProvider";
+
+ /**
+ * Create an overlay matching |config| and send it to |client|. Remember that potentially many
+ * providers are created.
+ */
+ public void createOverlay(AndroidOverlayClient client, AndroidOverlayConfig config) {
dcheng 2017/02/28 05:22:03 Normally, it's best to implement the interface in
liberato (no reviews please) 2017/03/06 07:51:04 i'll pick option 2. :) the reason is that this i
+ // We could also call |client.onInitialized| to succeed for example:
+ // AndroidOverlayImpl overlay = new AndroidOverlayImpl(client, config);
+ // client.onInitialized(overlay);
+ client.onDestroyed();
+ }
+
+ @Override
+ public void close() {}
+
+ @Override
+ public void onConnectionError(MojoException e) {}
+
+ /**
+ * Mojo factory.
+ */
+ public static class Factory implements InterfaceFactory<AndroidOverlayProvider> {
+ public Factory(Context context) {}
+
+ @Override
+ public AndroidOverlayProvider createImpl() {
+ return new AndroidOverlayProviderImpl();
+ }
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698