Commit 40e2e9ee authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Move OnClipboardHistoryPasted closer to paste

Before it was not getting hit on all code paths.

Bug: 1148396
Change-Id: I95c3d4a2a63f167dfc3d7bb94fc3dbc4af0bd132
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2535214Reviewed-by: default avatarAndrew Xu <andrewxu@chromium.org>
Commit-Queue: Alex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#826900}
parent ee0cab03
......@@ -280,9 +280,6 @@ void ClipboardHistoryControllerImpl::ExecuteSelectedMenuItem(int event_flags) {
// If no menu item is currently selected, we'll fallback to the first item.
menu_delegate_->ExecuteCommand(
command.value_or(ClipboardHistoryUtil::kFirstItemCommandId), event_flags);
for (auto& observer : observers_)
observer.OnClipboardHistoryPasted();
}
void ClipboardHistoryControllerImpl::ExecuteCommand(int command_id,
......@@ -340,6 +337,9 @@ void ClipboardHistoryControllerImpl::PasteMenuItemData(int command_id,
SendSyntheticKeyEvent(ui::VKEY_V, ui::EF_CONTROL_DOWN);
for (auto& observer : observers_)
observer.OnClipboardHistoryPasted();
if (!original_data)
return;
......
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