Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java |
diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java |
similarity index 89% |
copy from chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java |
copy to chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java |
index 50029d19efef259f4d3ae43cbd44f3f37aaf7705..bdcf54abeb5a4ebbd35b1b7158932f84f8633e05 100644 |
--- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClient.java |
+++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PwsClientImpl.java |
@@ -11,6 +11,8 @@ import org.chromium.base.Log; |
import org.chromium.base.ThreadUtils; |
import org.chromium.chrome.GoogleAPIKeys; |
import org.chromium.chrome.browser.ChromeVersionInfo; |
+import org.chromium.chrome.browser.physicalweb.PwsClient.FetchIconCallback; |
+import org.chromium.chrome.browser.physicalweb.PwsClient.ResolveScanCallback; |
import org.json.JSONArray; |
import org.json.JSONException; |
@@ -23,34 +25,11 @@ import java.util.Collection; |
/** |
* This class sends requests to the Physical Web Service. |
*/ |
-class PwsClient { |
+class PwsClientImpl implements PwsClient { |
private static final String TAG = "PhysicalWeb"; |
private static final String ENDPOINT_URL = |
"https://physicalweb.googleapis.com/v1alpha1/urls:resolve"; |
- /** |
- * Callback that is run after the PWS sends a response to a resolve-scan request. |
- */ |
- public interface ResolveScanCallback { |
- /** |
- * Handle newly returned PwsResults. |
- * @param pwsResults The results returned by the PWS. |
- */ |
- public void onPwsResults(Collection<PwsResult> pwsResults); |
- } |
- |
- /** |
- * Callback that is run after receiving the response to an icon fetch request. |
- */ |
- public interface FetchIconCallback { |
- /** |
- * Handle newly returned favicon Bitmaps. |
- * @param iconUrl The favicon URL. |
- * @param iconBitmap The icon image data. |
- */ |
- public void onIconReceived(String iconUrl, Bitmap iconBitmap); |
- } |
- |
private String getApiKey() { |
if (ChromeVersionInfo.isStableBuild()) { |
return GoogleAPIKeys.GOOGLE_API_KEY; |
@@ -108,6 +87,7 @@ class PwsClient { |
* @param broadcastUrls The URLs to resolve. |
* @param resolveScanCallback The callback to be run when the response is received. |
*/ |
+ @Override |
public void resolve(final Collection<String> broadcastUrls, |
final ResolveScanCallback resolveScanCallback) { |
// Create the response callback. |
@@ -154,6 +134,7 @@ class PwsClient { |
* @param iconUrl The URL of the favicon. |
* @param fetchIconCallback The callback to be run when the icon is received. |
*/ |
+ @Override |
public void fetchIcon(final String iconUrl, |
final FetchIconCallback fetchIconCallback) { |
// Create the response callback. |