Commit adcbf5f9 authored by Matthew Mourgos's avatar Matthew Mourgos Committed by Chromium LUCI CQ

Multipaste: Call observer function when removing clipboard history item.

ClipboardHistory::Observer::OnClipboardHistoryItemRemoved was only
called when removing an item from the list after the maximum number of
items was reached. This change also calls the removed function when an
item is manually removed with the 'x' button in the context menu.

Bug: 1154811
Change-Id: I274beba20d1671e3e7aabdcf7c0b17d97c29d547
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2569854
Commit-Queue: Matthew Mourgos <mmourgos@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#833560}
parent cf4624c8
...@@ -56,7 +56,10 @@ void ClipboardHistory::RemoveItemForId(const base::UnguessableToken& id) { ...@@ -56,7 +56,10 @@ void ClipboardHistory::RemoveItemForId(const base::UnguessableToken& id) {
if (iter == history_list_.cend()) if (iter == history_list_.cend())
return; return;
auto removed = std::move(*iter);
history_list_.erase(iter); history_list_.erase(iter);
for (auto& observer : observers_)
observer.OnClipboardHistoryItemRemoved(removed);
} }
void ClipboardHistory::OnClipboardDataChanged() { void ClipboardHistory::OnClipboardDataChanged() {
......
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