Chromium Code Reviews| Index: chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| diff --git a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| index 8a40c1376b79e61d3135b91b862c66ca5caa6786..b62e31ac4d4f649f719eaa4f87e313fecf3cffa9 100644 |
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java |
| @@ -97,6 +97,8 @@ import org.chromium.chrome.browser.offlinepages.OfflinePageUtils; |
| import org.chromium.chrome.browser.omaha.UpdateMenuItemHelper; |
| import org.chromium.chrome.browser.pageinfo.WebsiteSettingsPopup; |
| import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomizations; |
| +import org.chromium.chrome.browser.physicalweb.PhysicalWeb; |
| +import org.chromium.chrome.browser.physicalweb.PhysicalWebShareActivity; |
| import org.chromium.chrome.browser.preferences.ChromePreferenceManager; |
| import org.chromium.chrome.browser.preferences.PrefServiceBridge; |
| import org.chromium.chrome.browser.preferences.PreferencesLauncher; |
| @@ -1133,19 +1135,30 @@ public abstract class ChromeActivity extends AsyncInitializationActivity |
| final Tab currentTab = getActivityTab(); |
| if (currentTab == null) return; |
| + ShareHelper.enableOptions(this, getAdditionalShareOptionsList(currentTab), new Runnable() { |
| + @Override |
| + public void run() { |
| + triggerShare(currentTab, shareDirectly, isIncognito); |
| + } |
| + }); |
| + } |
| + |
| + public static List<Class> getAdditionalShareOptionsList(Tab currentTab) { |
|
cco3
2017/01/31 19:42:55
Why is this public?
Also, it's not clear to me th
iankc
2017/01/31 22:51:31
Acknowledged.
|
| + List<Class> options = new ArrayList<Class>(2); |
| + |
| + // Check and handle Printing option |
|
cco3
2017/01/31 19:42:55
Full stop after sentence comments. Same below.
iankc
2017/01/31 22:51:31
Done.
|
| PrintingController printingController = PrintingControllerImpl.getInstance(); |
| - if (printingController != null && !currentTab.isNativePage() && !printingController.isBusy() |
| + if (printingController != null && (currentTab == null || !currentTab.isNativePage()) |
|
mattreynolds
2017/01/31 20:30:33
If currentTab is null is it still possible for Phy
iankc
2017/01/31 22:51:30
Acknowledged.
|
| + && !printingController.isBusy() |
| && PrefServiceBridge.getInstance().isPrintingEnabled()) { |
| - PrintShareActivity.enablePrintShareOption(this, new Runnable() { |
| - @Override |
| - public void run() { |
| - triggerShare(currentTab, shareDirectly, isIncognito); |
| - } |
| - }); |
| - return; |
| + options.add(PrintShareActivity.class); |
| } |
| - triggerShare(currentTab, shareDirectly, isIncognito); |
| + // Check and handle Physical Web Sharing |
| + if (!PhysicalWeb.isSharingEnabled()) { |
|
cco3
2017/01/31 19:42:55
This isn't a sufficient check yet.
mattreynolds
2017/01/31 20:30:33
remove '!'
I'm not sure what permissions we shoul
iankc
2017/01/31 22:51:31
Done.
iankc
2017/01/31 22:51:31
Acknowledged.
|
| + options.add(PhysicalWebShareActivity.class); |
| + } |
| + return options; |
| } |
| private void triggerShare( |