| Index: chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
|
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
|
| index 8c7ca573b0a5f411ec634308cebc19c941add90e..3b6dbcb410a211aa0d46a6b62436de68f77ccd05 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java
|
| @@ -4,6 +4,7 @@
|
|
|
| package org.chromium.chrome.browser.physicalweb;
|
|
|
| +import android.content.Intent;
|
| import android.os.Build;
|
|
|
| import org.chromium.chrome.browser.ChromeActivity;
|
| @@ -15,9 +16,20 @@ import org.chromium.chrome.browser.share.ShareActivity;
|
| public class PhysicalWebShareActivity extends ShareActivity {
|
| @Override
|
| protected void handleShareAction(ChromeActivity triggeringActivity) {
|
| - // TODO(iankc): implement this.
|
| + String url = triggeringActivity.getActivityTab().getUrl();
|
| +
|
| + Intent intent = new Intent(this, PhysicalWebBroadcastService.class);
|
| + intent.putExtra(PhysicalWebBroadcastService.DISPLAY_URL_KEY, url);
|
| + startService(intent);
|
| }
|
|
|
| + /**
|
| + * Returns whether we should show this sharing option in the share sheet.
|
| + * Pre-conditions for Physical Web Sharing to be enabled:
|
| + * Device is Marshmallow or above.
|
| + * Device has sharing feature enabled.
|
| + * @return {@code true} if the feature should be enabled.
|
| + */
|
| public static boolean featureIsAvailable() {
|
| return PhysicalWeb.sharingIsEnabled() && Build.VERSION.SDK_INT >= Build.VERSION_CODES.M;
|
| }
|
|
|