Chromium Code Reviews| 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..c2d04ac163cf5b0f80abb59d6c9eac7afb08e762 |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWeb.java |
| @@ -0,0 +1,39 @@ |
| +// 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 { |
| + /** |
| + * Evaluate whether the environment is one in which the Physical Web should |
| + * be enabled. |
| + * @return true if the PhysicalWeb should be enabled |
| + */ |
| + public static boolean featureIsEnabled() { |
| + boolean allowedChannel = |
| + ChromeVersionInfo.isLocalBuild() || ChromeVersionInfo.isDevBuild(); |
| + boolean switchEnabled = |
| + CommandLine.getInstance().hasSwitch(ChromeSwitches.ENABLE_PHYSICAL_WEB); |
| + return allowedChannel && switchEnabled; |
| + } |
| + |
| + /** |
| + * Start the Physical Web feature. |
| + * At the moment, this only enables URL discovery over BLE. |
| + * @param application An instance of {@link ChromeApplication}, used to get the |
| + * appropriatePhysicalWebBleClient implementation. |
|
jdduke (slow)
2015/09/28 22:38:34
Nit: space after appropriate.
cco3
2015/09/28 23:20:24
Done.
|
| + */ |
| + public static void startPhysicalWeb(ChromeApplication application) { |
| + PhysicalWebBleClient physicalWebBleClient = PhysicalWebBleClient.getInstance(application); |
| + physicalWebBleClient.subscribe(); |
| + } |
| +} |