| 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 1e8816779e1bb3be30af768b3f5727e21768e25a..8d467e4a72b86ac3de28f255a7d79758fb3d9b80 100644
|
| --- a/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
| +++ b/chrome/android/java/src/org/chromium/chrome/browser/ChromeActivity.java
|
| @@ -100,7 +100,6 @@ import org.chromium.chrome.browser.partnercustomizations.PartnerBrowserCustomiza
|
| import org.chromium.chrome.browser.preferences.ChromePreferenceManager;
|
| import org.chromium.chrome.browser.preferences.PrefServiceBridge;
|
| import org.chromium.chrome.browser.preferences.PreferencesLauncher;
|
| -import org.chromium.chrome.browser.printing.PrintShareActivity;
|
| import org.chromium.chrome.browser.printing.TabPrinter;
|
| import org.chromium.chrome.browser.share.ShareHelper;
|
| import org.chromium.chrome.browser.snackbar.BottomContainer;
|
| @@ -1129,7 +1128,8 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
|
|
| /**
|
| * Triggered when the share menu item is selected.
|
| - * This creates and shows a share intent picker dialog or starts a share intent directly.
|
| + * This enables shareActivities, creates and shows a share intent picker dialog or starts
|
| + * a share intent directly.
|
| * @param shareDirectly Whether it should share directly with the activity that was most
|
| * recently used to share.
|
| * @param isIncognito Whether currentTab is incognito.
|
| @@ -1139,19 +1139,12 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
| final Tab currentTab = getActivityTab();
|
| if (currentTab == null) return;
|
|
|
| - PrintingController printingController = PrintingControllerImpl.getInstance();
|
| - if (printingController != null && !currentTab.isNativePage() && !printingController.isBusy()
|
| - && PrefServiceBridge.getInstance().isPrintingEnabled()) {
|
| - PrintShareActivity.enablePrintShareOption(this, new Runnable() {
|
| - @Override
|
| - public void run() {
|
| - triggerShare(currentTab, shareDirectly, isIncognito);
|
| - }
|
| - });
|
| - return;
|
| - }
|
| -
|
| - triggerShare(currentTab, shareDirectly, isIncognito);
|
| + ShareHelper.enableShareActivitiesAndStartShareIntent(this, currentTab, new Runnable() {
|
| + @Override
|
| + public void run() {
|
| + triggerShare(currentTab, shareDirectly, isIncognito);
|
| + }
|
| + });
|
| }
|
|
|
| private void triggerShare(
|
| @@ -1205,6 +1198,15 @@ public abstract class ChromeActivity extends AsyncInitializationActivity
|
| }
|
|
|
| /**
|
| + * Unregisters all potential options. This is because there could be
|
| + * state changes since options were enabled that would affect filterEnabledOptions
|
| + * to not return all enabled options.
|
| + */
|
| + public void unregisterShareActivities() {
|
| + ShareHelper.unregisterActivity(this);
|
| + }
|
| +
|
| + /**
|
| * @return Whether the activity is in overview mode.
|
| */
|
| public boolean isInOverviewMode() {
|
|
|