Chromium Code Reviews| 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 |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..c79c6ee8ef6c5cae695ae7f3fecfe3b59cbcb72c |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.java |
| @@ -0,0 +1,40 @@ |
| +// 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 android.content.Intent; |
| +import android.os.Bundle; |
| + |
| +import android.support.v7.app.AppCompatActivity; |
| + |
| +import org.chromium.chrome.browser.share.ShareHelper; |
| +import org.chromium.chrome.browser.util.IntentUtils; |
| + |
| +/** |
| + * A simple activity that allows Chrome to start the physical web sharing service. |
| + */ |
| +public class PhysicalWebShareActivity extends AppCompatActivity { |
| + |
| + private static final String TAG = "PhysicalWebShareActivity"; |
| + |
| + @Override |
| + protected void onCreate(Bundle savedInstanceState) { |
| + super.onCreate(savedInstanceState); |
| + |
| + try { |
| + Intent intent = getIntent(); |
| + if (intent == null) return; |
| + if (!Intent.ACTION_SEND.equals(intent.getAction())) return; |
| + if (!IntentUtils.safeHasExtra(intent, ShareHelper.EXTRA_TASK_ID)) return; |
| + handleBroadcastAction(); |
| + } finally { |
| + finish(); |
| + } |
| + } |
| + |
| + private void handleBroadcastAction() { |
| + //TODO(iankc): implement this. |
|
cco3
2017/02/02 00:58:58
Don't you need to call unregister here?
iankc
2017/02/02 01:52:24
Done.
|
| + } |
| +} |