OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 package org.chromium.chrome.browser.physicalweb; | 5 package org.chromium.chrome.browser.physicalweb; |
6 | 6 |
7 import org.chromium.chrome.browser.ChromeApplication; | 7 import org.chromium.chrome.browser.ChromeApplication; |
8 | 8 |
9 /** | 9 /** |
10 * Tool that reports information about conflicting clients. | 10 * Tool that reports information about conflicting clients. |
11 */ | 11 */ |
12 public class PhysicalWebEnvironment { | 12 public class PhysicalWebEnvironment { |
13 private static final Object INSTANCE_LOCK = new Object(); | 13 private static final Object INSTANCE_LOCK = new Object(); |
14 private static PhysicalWebEnvironment sInstance = null; | 14 private static PhysicalWebEnvironment sInstance; |
15 | 15 |
16 /** | 16 /** |
17 * Get a singleton instance of this class. | 17 * Get a singleton instance of this class. |
18 * @param chromeApplication An instance of {@link ChromeApplication}, used t
o get the | 18 * @param chromeApplication An instance of {@link ChromeApplication}, used t
o get the |
19 * appropriate PhysicalWebEnvironment implementation. | 19 * appropriate PhysicalWebEnvironment implementation. |
20 * @return an instance of this class (or subclass) as decided by the applica
tion parameter | 20 * @return an instance of this class (or subclass) as decided by the applica
tion parameter |
21 */ | 21 */ |
22 public static PhysicalWebEnvironment getInstance(ChromeApplication chromeApp
lication) { | 22 public static PhysicalWebEnvironment getInstance(ChromeApplication chromeApp
lication) { |
23 synchronized (INSTANCE_LOCK) { | 23 synchronized (INSTANCE_LOCK) { |
24 if (sInstance == null) { | 24 if (sInstance == null) { |
25 sInstance = chromeApplication.createPhysicalWebEnvironment(); | 25 sInstance = chromeApplication.createPhysicalWebEnvironment(); |
26 } | 26 } |
27 } | 27 } |
28 return sInstance; | 28 return sInstance; |
29 } | 29 } |
30 | 30 |
31 /** | 31 /** |
32 * Reports whether the environment has another notification-based Physical W
eb client enabled. | 32 * Reports whether the environment has another notification-based Physical W
eb client enabled. |
33 * @return true if there is another notification-based Physical Web client e
nabled. | 33 * @return true if there is another notification-based Physical Web client e
nabled. |
34 */ | 34 */ |
35 public boolean hasNotificationBasedClient() { | 35 public boolean hasNotificationBasedClient() { |
36 return false; | 36 return false; |
37 } | 37 } |
38 } | 38 } |
OLD | NEW |