Commit c71d317e authored by Aya ElAttar's avatar Aya ElAttar Committed by Commit Bot

DLP: Avoid showing notification for clipboardhistory

When ClipboardHistory tries to check whether clipboard
data read is allowed, no notification should be shown
because this action isn't triggered by the user.

Bug: 
Change-Id: If9d82fb92660a322c35a276454ff0d6be1a7fcda
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2514212Reviewed-by: default avatarDavid Black <dmblack@google.com>
Commit-Queue: Aya Elsayed <ayaelattar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#824064}
parent aadeb16f
...@@ -68,9 +68,12 @@ void ClipboardHistoryMenuModelAdapter::Run( ...@@ -68,9 +68,12 @@ void ClipboardHistoryMenuModelAdapter::Run(
// Enable or disable the command depending on whether its corresponding // Enable or disable the command depending on whether its corresponding
// clipboard history item is allowed to read or not. // clipboard history item is allowed to read or not.
model_->SetEnabledAt( // This clipboard read isn't initiated by the user, that's why it shouldn't
model_->GetIndexOfCommandId(command_id), // notify if the clipboard is restricted.
IsDataReadAllowed(item.data().source(), /*data_dst=*/nullptr)); ui::DataTransferEndpoint data_dst(ui::EndpointType::kDefault,
/*notify_if_restricted=*/false);
model_->SetEnabledAt(model_->GetIndexOfCommandId(command_id),
IsDataReadAllowed(item.data().source(), &data_dst));
item_snapshots_.emplace(command_id, item); item_snapshots_.emplace(command_id, item);
++command_id; ++command_id;
......
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