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

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

Issue 1326593006: Add the Physical Web to Chrome on Android (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add an OWNERS file 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/PhysicalWeb.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
new file mode 100644
index 0000000000000000000000000000000000000000..4adeff9db1870cc847c85eaf3f0f6a61fb3eb232
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java
@@ -0,0 +1,28 @@
+// 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.CommandLine;
+import org.chromium.chrome.browser.ChromeApplication;
+import org.chromium.chrome.browser.ChromeSwitches;
+import org.chromium.chrome.browser.ChromeVersionInfo;
+
+/**
+ * This class provides the basic interface to the Physical Web feature.
+ */
+public class PhysicalWeb {
+ public static boolean featureIsEnabled() {
+ boolean allowedChannel =
+ ChromeVersionInfo.isLocalBuild() || ChromeVersionInfo.isDevBuild();
aurimas (slooooooooow) 2015/09/10 17:09:03 It seems like you are enabling this in Chrome Dev
cco3 2015/09/11 17:10:46 Is that a problem even though it's behind a flag?
+ boolean switchEnabled =
+ CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_PHYSICAL_WEB);
+ return allowedChannel && switchEnabled;
+ }
+
+ public static void startPhysicalWeb(ChromeApplication application) {
+ PhysicalWebBleClient physicalWebBleClient = PhysicalWebBleClient.getInstance(application);
+ physicalWebBleClient.subscribe();
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698