Commit 3f65ee03 authored by ckitagawa's avatar ckitagawa Committed by Commit Bot

[Paint Preview] only capture http/https

Only capture previews of http/https pages. Some people have been
suprised when an FDT was shown on chrome://flags and capturing only
really makes sense for http/https anyways.

Change-Id: Idaaa44711abc6b2cf2cd029277f5bf23f4eae5cf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2377558Reviewed-by: default avatarMehran Mahmoudi <mahmoudi@chromium.org>
Commit-Queue: Calder Kitagawa <ckitagawa@chromium.org>
Cr-Commit-Position: refs/heads/master@{#802283}
parent 1f88a893
...@@ -63,8 +63,10 @@ public class PaintPreviewTabService implements NativePaintPreviewServiceProvider ...@@ -63,8 +63,10 @@ public class PaintPreviewTabService implements NativePaintPreviewServiceProvider
} }
private boolean qualifiesForCapture(Tab tab) { private boolean qualifiesForCapture(Tab tab) {
String scheme = tab.getUrl().getScheme();
boolean schemeAllowed = scheme.equals("http") || scheme.equals("https");
return !tab.isIncognito() && !tab.isNativePage() && !tab.isShowingErrorPage() return !tab.isIncognito() && !tab.isNativePage() && !tab.isShowingErrorPage()
&& tab.getWebContents() != null; && tab.getWebContents() != null && schemeAllowed;
} }
} }
......
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