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

Unified Diff: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java

Issue 1326593006: Add the Physical Web to Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Handled jdduke's comments Created 5 years, 3 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/physicalweb/PhysicalWebBleClient.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java
new file mode 100644
index 0000000000000000000000000000000000000000..97284a54056be840db466e0b43481ff221d4ea99
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebBleClient.java
@@ -0,0 +1,41 @@
+// Copyright 2015 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.physicalweb;
+
+import org.chromium.base.Log;
+import org.chromium.chrome.browser.ChromeApplication;
+
+/**
+ * The Client that harvests URLs from BLE signals.
+ * This class is designed to scan URSs from Bluetooth Low Energy beacons.
+ * This class is currently an empty implementation and must be extended by a
+ * subclass.
+ */
+public class PhysicalWebBleClient {
+ private static PhysicalWebBleClient sInstance = null;
+ private static final String TAG = "PhysicalWeb";
+
+ /**
+ * Get a singleton instance of this class.
+ * @param chromeApplication An instance of {@link ChromeApplication}, used to get the
+ * appropriate PhysicalWebBleClient implementation.
+ * @return an instance of this class (or subclass) as decided by the
+ * application parameter
+ */
+ public static PhysicalWebBleClient getInstance(ChromeApplication chromeApplication) {
+ if (sInstance == null) {
+ sInstance = chromeApplication.createPhysicalWebBleClient();
+ }
+ return sInstance;
+ }
+
+ /**
+ * Begin subscribing to URLs broadcasted from BLE beacons.
+ * This currently does nothing and should be overridden by a subclass.
+ */
+ void subscribe() {
+ Log.d(TAG, "subscribing in empty client");
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698