Commit 2bdbb918 authored by ckitagawa's avatar ckitagawa Committed by Commit Bot

[Paint Preview] Avoid orphaning extra previews in demo mode

If one attempts to show multiple paint previews of the same tab we
currently layer multiple atop each other resulting in prior versions
being orphaned and stuck in the Tab's ContentView. Instead we should
prevent showing multiple times.

We could optionally add a toast here to indicate an abort occurred,
but it would be better to just use the UI elements we intend to use for
other usecases when they are ready.

Bug: 1069177
Change-Id: I0251a17cd7ce819c9d2644a3efe58d9d8b6204da
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2142398
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Reviewed-by: default avatarMehran Mahmoudi <mahmoudi@chromium.org>
Cr-Commit-Position: refs/heads/master@{#757582}
parent aaa65784
......@@ -35,6 +35,8 @@ public class PaintPreviewDemoManager implements Destroyable {
}
public void showPaintPreviewDemo() {
if (isShowingPaintPreviewDemo()) return;
if (mPaintPreviewDemoService == null) {
mPaintPreviewDemoService = PaintPreviewDemoServiceFactory.getServiceInstance();
}
......
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