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..29f689251d9a235d758a9bf96aa4d394a32d3056 |
| --- /dev/null |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/physicalweb/PhysicalWebShareActivity.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 android.content.Intent; |
| +import android.os.Bundle; |
| + |
| +import android.support.v7.app.AppCompatActivity; |
| + |
| +import org.chromium.base.Log; |
| +import org.chromium.chrome.browser.share.ShareHelper; |
| +import org.chromium.chrome.browser.util.IntentUtils; |
| + |
| +/** |
| + * A simple activity that allows Chrome to expose print as an option in the share menu. |
|
cco3
2017/01/31 19:42:55
No printing
iankc
2017/01/31 22:51:31
Done.
|
| + */ |
| +public class PhysicalWebShareActivity extends AppCompatActivity { |
| + |
| + private static final String TAG = "pw_share"; |
|
cco3
2017/01/31 19:42:55
PhysicalWeb
iankc
2017/01/31 22:51:31
Done.
|
| + |
| + @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(getIntent(), ShareHelper.EXTRA_TASK_ID)) return; |
|
cco3
2017/01/31 19:42:56
Just use intent (not getIntent())
iankc
2017/01/31 22:51:31
Done.
|
| + Log.v(TAG, "Starting Service here"); |
|
cco3
2017/01/31 19:42:55
I'd drop this.
cco3
2017/01/31 19:42:55
Also, I'd create a new private handleBroadcastActi
iankc
2017/01/31 22:51:31
Done.
iankc
2017/01/31 22:51:31
Done.
|
| + } finally { |
| + finish(); |
| + } |
| + } |
| +} |