1 // Copyright 2019 The Chromium Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 package org.chromium.chrome.browser.share; 6 7 import org.chromium.chrome.browser.share.ShareDelegateImpl.ShareOrigin; 8 import org.chromium.chrome.browser.tab.Tab; 9 import org.chromium.components.browser_ui.share.ShareParams; 10 11 /** 12 * Interface to expose sharing to external classes. 13 */ 14 public interface ShareDelegate { 15 /** 16 * Initiate a share based on the provided ShareParams. 17 * 18 * @param params The share parameters. 19 * @param chromeShareExtras The extras not contained in {@code params}. 20 * @param shareOrigin Where the share originated. 21 */ share( ShareParams params, ChromeShareExtras chromeShareExtras, @ShareOrigin int shareOrigin)22 void share( 23 ShareParams params, ChromeShareExtras chromeShareExtras, @ShareOrigin int shareOrigin); 24 25 /** 26 * Initiate a share for the provided Tab. 27 * 28 * @param currentTab The Tab to be shared. 29 * @param shareDirectly If this share should be sent directly to the last used share target. 30 * @param shareOrigin Where the share originated. 31 */ share(Tab currentTab, boolean shareDirectly, @ShareOrigin int shareOrigin)32 void share(Tab currentTab, boolean shareDirectly, @ShareOrigin int shareOrigin); 33 34 /** 35 * Check if the custom share sheet is enabled. 36 */ isSharingHubV1Enabled()37 boolean isSharingHubV1Enabled(); 38 39 /** 40 * Check if v1.5 of the custom share sheet is enabled. 41 */ isSharingHubV15Enabled()42 boolean isSharingHubV15Enabled(); 43 } 44