Skip to content

Commit

Permalink
Remove capture notification when on user changed
Browse files Browse the repository at this point in the history
This bug is caused by the screen capture notification in the message
center when switching to a different user. In this cl this notification
is removed when on user switched.

Bug: 1176154

(cherry picked from commit eeb1596)

Change-Id: I85edcf42eaf6f08f32863c4c9b42191e8b5e81ef
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2730853
Reviewed-by: Ahmed Mehfooz <amehfooz@chromium.org>
Reviewed-by: Ahmed Fakhry <afakhry@chromium.org>
Commit-Queue: Jiaming Cheng <jiamingc@chromium.org>
Cr-Original-Commit-Position: refs/heads/master@{#859543}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2733656
Cr-Commit-Position: refs/branch-heads/4430@{#244}
Cr-Branched-From: e5ce7dc-refs/heads/master@{#857950}
  • Loading branch information
Jiaming Cheng authored and Chromium LUCI CQ committed Mar 8, 2021
1 parent 55e8733 commit 39468b2
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions ash/capture_mode/capture_mode_controller.cc
Original file line number Diff line number Diff line change
Expand Up @@ -540,6 +540,11 @@ void CaptureModeController::OnRecordingEnded(bool success) {
void CaptureModeController::OnActiveUserSessionChanged(
const AccountId& account_id) {
EndSessionOrRecording(EndRecordingReason::kActiveUserChange);

// Remove the previous notification when switching to another user.
auto* message_center = message_center::MessageCenter::Get();
message_center->RemoveNotification(kScreenCaptureNotificationId,
/*by_user=*/false);
}

void CaptureModeController::OnSessionStateChanged(
Expand Down

0 comments on commit 39468b2

Please sign in to comment.