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

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

Issue 1927593004: Add a PhysicalWebEnvironment class (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 4 years, 7 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/PhysicalWebEnvironment.java
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java
new file mode 100644
index 0000000000000000000000000000000000000000..26655d3e0a1233d0bea741edd50e8f661e668c2d
--- /dev/null
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebEnvironment.java
@@ -0,0 +1,37 @@
+// 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.physicalweb;
+
+import org.chromium.base.ThreadUtils;
+import org.chromium.chrome.browser.ChromeApplication;
+
+/**
+ * Tool that reports information about conflicting clients.
+ */
+public class PhysicalWebEnvironment {
+ private static PhysicalWebEnvironment sInstance = null;
+
+ /**
+ * Get a singleton instance of this class.
+ * @param chromeApplication An instance of {@link ChromeApplication}, used to get the
+ * appropriate PhysicalWebEnvironment implementation.
+ * @return an instance of this class (or subclass) as decided by the application parameter
+ */
+ public static PhysicalWebEnvironment getInstance(ChromeApplication chromeApplication) {
+ ThreadUtils.assertOnUiThread();
+ if (sInstance == null) {
+ sInstance = chromeApplication.createPhysicalWebEnvironment();
+ }
+ return sInstance;
+ }
+
+ /**
+ * Reports whether the environment has another notification-based Physical Web client enabled.
+ * @return true if there is another notification-based Physical Web client enabled.
+ */
+ public boolean hasNotificationBasedClient() {
+ return false;
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698