Commit 991178ea authored by Jeffrey Cohen's avatar Jeffrey Cohen Committed by Commit Bot

[Screenshot] add screenshot button to new sharing hub

Bug: 1009124
Change-Id: I083464bcae4f431bcb094aed4d9e4edc0d670eb2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1959398Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Commit-Queue: Jeffrey Cohen <jeffreycohen@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726095}
parent 5833d726
......@@ -14,6 +14,7 @@ import android.view.View.OnClickListener;
import org.chromium.chrome.R;
import org.chromium.chrome.browser.ActivityTabProvider;
import org.chromium.chrome.browser.ChromeFeatureList;
import org.chromium.chrome.browser.send_tab_to_self.SendTabToSelfShareActivity;
import org.chromium.chrome.browser.share.qrcode.QrCodeCoordinator;
import org.chromium.chrome.browser.tab.Tab;
......@@ -110,13 +111,31 @@ public class ShareSheetCoordinator {
(ClipboardManager) activity.getSystemService(Context.CLIPBOARD_SERVICE);
ClipData clip = ClipData.newPlainText(entry.getTitle(), entry.getUrl());
clipboard.setPrimaryClip(clip);
Toast toast =
Toast.makeText(activity, R.string.link_copied, Toast.LENGTH_SHORT);
toast.show();
});
models.add(copyPropertyModel);
// ScreenShot
PropertyModel screenshotPropertyModel = null;
if (ChromeFeatureList.isEnabled(ChromeFeatureList.CHROME_SHARE_SCREENSHOT)) {
screenshotPropertyModel =
new PropertyModel.Builder(ShareSheetItemViewProperties.ALL_KEYS)
.with(ShareSheetItemViewProperties.ICON,
AppCompatResources.getDrawable(activity, R.drawable.screenshot))
.with(ShareSheetItemViewProperties.LABEL,
activity.getResources().getString(R.string.sharing_screenshot))
.with(ShareSheetItemViewProperties.CLICK_LISTENER,
(shareParams)
-> {
// TODO (crbug.1024586) initiate screenshot
// fragment.
})
.build();
models.add(screenshotPropertyModel);
}
return models;
}
......
......@@ -4088,6 +4088,10 @@ The site does NOT gain access to the camera. The camera images are only visible
Copy link
</message>
<message name="IDS_SHARING_SCREENSHOT" desc="Label for Screenshot button in the sharing hub.">
Screenshot
</message>
<message name="IDS_LINK_COPIED" desc="Text shown in the toast notification when Copy Link is selected in the sharing hub.">
Link Copied
</message>
......
ebb50a402703a36fb9900bb2f6368a623e561df7
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment