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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java

Issue 2132163002: Add BlimpClientContext and factory with real and dummy implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move-blimp-client-core-public-to-blimp-client
Patch Set: git merge origin/master before CQ for good measure Created 4 years, 5 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: chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java b/chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java
new file mode 100644
index 0000000000000000000000000000000000000000..c5459309510c39ea814cff14dce927910f5b34b4
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/blimp/BlimpClientContextFactory.java
@@ -0,0 +1,29 @@
+// Copyright 2016 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.chrome.browser.blimp;
+
+import org.chromium.blimp_public.BlimpClientContext;
+import org.chromium.chrome.browser.profiles.Profile;
+
+/**
+ * This factory creates BlimpClientContexts for the given {@link Profile}.
+ */
+public final class BlimpClientContextFactory {
+ // Don't instantiate me.
+ private BlimpClientContextFactory() {}
+
+ /**
+ * A factory method to build a {@link BlimpClientContext} object. Each Profile only ever has
+ * a single {@link BlimpClientContext}, so the first this method is called (or from native),
+ * the {@link BlimpClientContext} will be created, and later calls will return the already
+ * created instance.
+ * @return The {@link BlimpClientContext} for the given profile object.
+ */
+ public static BlimpClientContext getBlimpClientContextForProfile(Profile profile) {
+ return nativeGetBlimpClientContextForProfile(profile);
+ }
+
+ private static native BlimpClientContext nativeGetBlimpClientContextForProfile(Profile profile);
+}

Powered by Google App Engine
This is Rietveld 408576698