Commit 1293c054 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

Cros: Use same criteria for added and removed

Just check for whether something can be rendered in HTML using
the same criteria. Forgot to update this line when I changed
the criteria on OnClipboardHistoryItemAdded.

Bug: 1138665
Change-Id: Ic50fcec0bd78a1ab5d6090024fb54de79141bec5
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2473165Reviewed-by: default avatarAndrew Xu <andrewxu@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#817289}
parent 7eee7845
......@@ -267,8 +267,10 @@ void ClipboardHistoryResourceManager::OnClipboardHistoryItemAdded(
void ClipboardHistoryResourceManager::OnClipboardHistoryItemRemoved(
const ClipboardHistoryItem& item) {
// For items that will not be represented by their rendered HTML, do nothing.
if (!item.data().bitmap().isNull() || item.data().markup_data().empty())
if (ClipboardHistoryUtil::CalculateMainFormat(item.data()) !=
ui::ClipboardInternalFormat::kHtml) {
return;
}
// We should have an image model in the cache.
auto cached_image_model = base::ConstCastIterator(
......
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