Commit 8fe61c82 authored by Marina Ciocea's avatar Marina Ciocea Committed by Commit Bot

Screen capture UI: don't recreate the widget if it already exists.

Bug: 1001503
Change-Id: I28c6c8445407315d8b2e9ab364cfb86f451758d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1848385
Commit-Queue: Marina Ciocea <marinaciocea@chromium.org>
Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704321}
parent c8d02dea
......@@ -175,6 +175,9 @@ ScreenCaptureNotificationUIViews::~ScreenCaptureNotificationUIViews() {
gfx::NativeViewId ScreenCaptureNotificationUIViews::OnStarted(
base::OnceClosure stop_callback,
content::MediaStreamUI::SourceCallback source_callback) {
if (GetWidget())
return 0;
stop_callback_ = std::move(stop_callback);
source_callback_ = std::move(source_callback);
......@@ -225,11 +228,7 @@ gfx::NativeViewId ScreenCaptureNotificationUIViews::OnStarted(
widget->SetOpacity(kWindowAlphaValue);
widget->SetVisibleOnAllWorkspaces(true);
#if defined(OS_WIN)
return gfx::NativeViewId(views::HWNDForWidget(widget));
#else
return 0;
#endif
}
void ScreenCaptureNotificationUIViews::DeleteDelegate() {
......
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